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

C API to pin domain to C thread ? #753

Open
nojb opened this issue Nov 22, 2021 · 0 comments
Open

C API to pin domain to C thread ? #753

nojb opened this issue Nov 22, 2021 · 0 comments

Comments

@nojb
Copy link
Contributor

nojb commented Nov 22, 2021

(This was discussed during the WG1 meeting today 22/11/2021, and the conclusion was that there is some design work to do.)

The question is how to design an API that would allow creating a domain "pinned" to an existing C thread, from C. One use-case is when the main program is written in C or some other language and this main program wants to call back into OCaml to do some computation (potentially short lived) and return the result to the main program. As domain creation is relatively costly, the idea would be that the C threads (and thus the domain pinned to them) would be long-lived, and not create a new domain for each call back into OCaml.

Of course, the actual solution may involve a slightly different approach and/or abstraction. @avsm mentioned also another use-case, namely interfacing with the Grand Central Dispatch API on macOS.

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

No branches or pull requests

1 participant