On Fri, Jul 1, 2011 at 7:09 PM, Fabrice Le Fessant
<[email protected]> wrote:
> 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, thanks.

>> 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,

No.

> and then you call camlidl_alloc_small(). Shouldn't you hold the master lock
> while allocating ?

Of course. This function is called from C when no Ocaml code is
running and the Ocaml master lock is released. So I acquire it on
enter  (camlidl_acquire_runtime), call an Ocaml callback and release
on return (camlidl_release_runtime).

- Dmitry Bely

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to