As noted in #752, waiting for a fixed buffer couldn't be cancelled. This adds support for that.
I'm using this PR to test out the Picos style of cancellation. Normally, Eio programs set a cancel function to be invoked immediately when the fiber is cancelled, but Picos instead just schedules the cancelled fiber to be resumed and the clean-up actions happen later.
The new style introduces an annoying extra state, where the operation is half-cancelled (the cancellation has happened, but the fiber is still registered as waiting for a buffer), and we need to handle that by retrying. On the other hand, it means no user code runs in the scheduler's context, and potentially allows cancellation from another domain.
As noted in #752, waiting for a fixed buffer couldn't be cancelled. This adds support for that.
I'm using this PR to test out the Picos style of cancellation. Normally, Eio programs set a cancel function to be invoked immediately when the fiber is cancelled, but Picos instead just schedules the cancelled fiber to be resumed and the clean-up actions happen later.
The new style introduces an annoying extra state, where the operation is half-cancelled (the cancellation has happened, but the fiber is still registered as waiting for a buffer), and we need to handle that by retrying. On the other hand, it means no user code runs in the scheduler's context, and potentially allows cancellation from another domain.