You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new systhreads implementation now contains 4 FIXMEs/TODOs in systhreads/st_stubs.c.
/* Cleanup the thread machinery when the runtime is shut down. Joining the tick thread take 25ms on average / 50ms in the worst case, so we don't do it on program exit. (FIXME: not implemented in OCaml 5 yet) */ Note: the safe solution for multicore is likely more involved, one idea is to use condition variables with timedwait.
caml_thread_reinitialize (best-effort fork with multiple threads): /* FIXME: The same should be done (or not) for IO mutexes (as in the pre-multicore world). However there they might be locked by someone else, and we are probably in an inconsistent state. */
Unclear initialization of domain variables related to exception handling in bytecode inside caml_thread_new_info. Ideally, one should find a way to factor caml_thread_new_info and domain_create regarding the initialization of relevant domain variables. See the discussion starting here: Refactor caml_c_thread_(un)register to fix various bugs #12834 (comment)
C threads registered as systhread do not behave as expected in case of an uncaught exception. If an exception is uncaught, caml_fatal_uncaught_exception is called and the program stops. This is in contrast with regular systhreads: in case of an uncaught exception, the thread stops and an error is output on stderr, and Thread.set_uncaught_exception_handler is obeyed. (Reported here: Refactor caml_c_thread_(un)register to fix various bugs #12834 (comment))
The text was updated successfully, but these errors were encountered:
The second one is now treated in a series of commits (#12409, #12410). I would prefer to let other people deal with the other issues and I am unsubscribing from this issue, notably to avoid being pinged by the stale bot in case nothing is done (just so you know in case you need to ping me).
The new systhreads implementation now contains 4 FIXMEs/TODOs in
systhreads/st_stubs.c
./* Cleanup the thread machinery when the runtime is shut down. Joining the tick thread take 25ms on average / 50ms in the worst case, so we don't do it on program exit. (FIXME: not implemented in OCaml 5 yet) */
Note: the safe solution for multicore is likely more involved, one idea is to use condition variables with timedwait./* FIXME: this should return an encoded exception for use in domain_thread_func, but the latter is not ready to handle it yet. */
(related: possible memory-leak on failed domain backup thread installation #12269)fork
with multiple threads):/* FIXME: The same should be done (or not) for IO mutexes (as in the pre-multicore world). However there they might be locked by someone else, and we are probably in an inconsistent state. */
caml_thread_new_info
. Ideally, one should find a way to factorcaml_thread_new_info
anddomain_create
regarding the initialization of relevant domain variables. See the discussion starting here: Refactor caml_c_thread_(un)register to fix various bugs #12834 (comment)caml_fatal_uncaught_exception
is called and the program stops. This is in contrast with regular systhreads: in case of an uncaught exception, the thread stops and an error is output on stderr, andThread.set_uncaught_exception_handler
is obeyed. (Reported here: Refactor caml_c_thread_(un)register to fix various bugs #12834 (comment))The text was updated successfully, but these errors were encountered: