On 07/01/2011 04:45 PM, Dmitry Bely wrote: >> Initialization to 0 for _varg is OK, of course. Is it the reply to your former question ? > Yes, that's my modification. Original camlidl is not thread-safe. > Basically camlidl_acquire_runtime does caml_c_thread_register and > caml_leave_blocking_section. camlidl_release_runtime points to > caml_enter_blocking_section. If I understand your code, you release the master lock on the GC, and then you call camlidl_alloc_small(). Shouldn't you hold the master lock while allocating ? Fabrice