Module In_thread.When_finished
When_finished
describes how In_thread.run f
behaves when the helper thread finishes f ()
.
type t
=
val all : t list
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val default : t Core.ref
default
defines the default value used forIn_thread.run
's?when_finished
argument. Changes todefault
affect subsequent calls toIn_thread.run
. Initially,default = Try_to_take_the_async_lock
, which typically leads to better latency by avoiding an extra context switch to pass the result to the Async scheduler thread. However, there are applications (e.g. jenga) whereNotify_the_scheduler
leads to significantly higher throughput by greatly decreasing the total number of Async cycles.