caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Threaded C code and callbacks
@ 2002-08-12 17:24 Olivier Andrieu
  0 siblings, 0 replies; only message in thread
From: Olivier Andrieu @ 2002-08-12 17:24 UTC (permalink / raw)
  To: caml-list

Hi,

There's a C library I'd like to interface with ocaml but it is
multithreaded.  In the API, one can set some callbacks that are called
asynchronously.  Of course, I'd like these callbacks to be caml
functions.  The problem is that I cannot simply use `callback_exn'
because when the callback is triggered another caml thread may be 
running ; callback_exn doesn't seem to check the mutex (or whatever)
that guarantees that only one caml thread is running. 

I tried various hacks involving some mutex shared by caml and the C
stub code but it stills crashes at some point.

Any idea ? Or is this definitively impossible ? (I'm not very familiar
with the internal's of ocaml's threading machinery).

-- 
   Olivier
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-12 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-12 17:24 [Caml-list] Threaded C code and callbacks Olivier Andrieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).