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

Add support for domain local await #494

Merged
merged 1 commit into from May 3, 2023
Merged

Conversation

polytypic
Copy link
Contributor

@polytypic polytypic commented Apr 24, 2023

This PR adds domain local await support to Eio. Domain local await allows blocking abstractions to work across different schedulers.

I've also made a similar PR to Domainslib. If and when both Eio and Domainslib merge the support for domain local await, it should be possible to use upcoming version of kcas to easily communicate between Eio and Domainslib domains. Perhaps lockfree could also adopt use of domain local await until we get some official blocking mechanism.

@polytypic polytypic force-pushed the add-domain-local-await-support branch 2 times, most recently from e9b7703 to 0a7d1fd Compare April 24, 2023 18:51
@talex5
Copy link
Collaborator

talex5 commented Apr 25, 2023

Interesting. I guess this doesn't even need any changes in Eio. You could just run any Eio event loop and then wrap Domain_mgr to install this handler in all new domains, right?

lib_eio/core/dla.ml Outdated Show resolved Hide resolved
lib_eio/core/dla.ml Outdated Show resolved Hide resolved
@polytypic polytypic force-pushed the add-domain-local-await-support branch 2 times, most recently from 7921d00 to 5bb91d2 Compare April 26, 2023 16:43
@polytypic polytypic changed the title WIP: Add support for domain local await Add support for domain local await Apr 26, 2023
@polytypic
Copy link
Contributor Author

polytypic commented Apr 26, 2023

Interesting. I guess this doesn't even need any changes in Eio. You could just run any Eio event loop and then wrap Domain_mgr to install this handler in all new domains, right?

Yes, I think for many schedulers it would be possible to provide domain local await outside of the scheduler by implementing it in terms of the public API of the scheduler and then installing it within a fiber running on the scheduler. However, for better UX / DX it is preferable to have schedulers provide the support directly. Of course, DLA is experimental at this stage and it is quite possible that it might be replaced with some official standard blocking mechanism, but I think that for the short term it would be great to be able to have various libraries that need blocking to be able to cooperate through it.

@polytypic polytypic force-pushed the add-domain-local-await-support branch 4 times, most recently from 22f9e38 to a3e0e62 Compare April 28, 2023 19:37
@polytypic polytypic marked this pull request as ready for review April 28, 2023 19:37
@polytypic polytypic requested review from a team and talex5 April 28, 2023 19:43
lib_eio/core/dla.ml Outdated Show resolved Hide resolved
@polytypic polytypic requested a review from talex5 May 2, 2023 10:52
Co-authored-by: Thomas Leonard <talex5@gmail.com>
@talex5 talex5 force-pushed the add-domain-local-await-support branch from cf044ae to f55c105 Compare May 3, 2023 09:29
Copy link
Collaborator

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (I just squashed and rebased it).

@talex5 talex5 merged commit 543d77b into main May 3, 2023
5 of 6 checks passed
@talex5 talex5 deleted the add-domain-local-await-support branch May 3, 2023 09:43
@talex5 talex5 added this to the 0.10 milestone May 31, 2023
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.

None yet

2 participants