I don't find this surprising, and I don't think it's a problem with
OCaml or the standard library (or at least, it's not specific to OCaml).

Another solution to this which hasn't already been noted is to have
your signal write one byte on a pipe which "loops back" to the same
process, and then use a reactor / select / whatever in the main
program to catch this event.

http://cr.yp.to/docs/selfpipe.html

You might need to write such a signal handler in C to ensure it's
really safe.  In our experience, writing signal handlers correctly is
hard.  (Perhaps not as hard as all the scary stuff that happens with
threads, eg:
http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them
 )

Rich.

-- 
Richard Jones
Red Hat

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