yallop / ocaml-ctypes

Library for binding to C libraries using pure OCaml
MIT License
363 stars 95 forks source link

Question: is it safe for Lwt_preemptive to switch to full parallelism? #635

Closed aantron closed 1 year ago

aantron commented 4 years ago

Is the code generated for concurrency policy `Lwt_preemptive, specifically only the portion generated by Ctypes, safe if Lwt_preemptive switches from current OCaml threads to the fully-parallel runtime in multicore? I would imagine so, but I'd like to confirm.

The Ctypes user's bound code that actually runs is a separate matter outside the scope of the question that I am intending :)

yallop commented 4 years ago

I think we should make sure this works --- i.e. consider any loss of safety when switching to multicore to be a bug (and fix it).