Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eio_linux: allow alloc_fixed_or_wait to be cancelled #753

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

talex5
Copy link
Collaborator

@talex5 talex5 commented Sep 5, 2024

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.

@talex5 talex5 force-pushed the cancel-alloc-fixed branch 2 times, most recently from a987a18 to 2fbb2b6 Compare September 6, 2024 16:11
@talex5 talex5 merged commit e2dc1d7 into ocaml-multicore:main Sep 6, 2024
4 of 5 checks passed
@talex5 talex5 deleted the cancel-alloc-fixed branch September 6, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant