Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
C-threads & callbacks
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] C-threads & callbacks
> As it seems, it is not possible to run OCaml-code linked with thread
> support while letting C-threads perform callbacks.  This has already
> been a topic on the list a while ago.

I don't understand what you are refering to. I don't think there's a 
problem as long as you take care to acquire ocaml's global lock to 
exectue the callbacks.

#include <caml/signals.h>
callback(*caml_named_value("myfun"), Val_unit);

This ensures that callbacks into caml are properly serialized.