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
[Caml-list] Thread in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-16 (11:22)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Thread in OCaml

Le 16 avr. 04, à 12:30, Christophe Raffalli a écrit :

> 1) why the name enter(resp leaving)_blocking_section to release(resp 
> aquire) a mutex ? you aquire a mutex when you want to block other 
> threads. The name seems inversed to me and this did not help.
I guess it is to suggest that you are going to enter a section where C 
calls may block. The names were given from the perpsective of what 
happens between enter/leave.

In my opinion, what really doesn't help is that it is not documented 
_at all_ in the the manual...

> 2) is there a way to have two files wrap_glut.c one with 
> enter/leaing_blocking_section the other without (or MACROS), the right 
> file being used depending if the -thread or -vmthread option is given
Using a library should not interfere with other part of the ocaml 
system. Since glut has this (bad) idea of a loop that never returns 
enter/leave_blocking_section should _always_ be used in the stubs so 
that signal handlers (see Sys.signal) can be executed. Note that in 
that case it is important that the callbacks from C into caml 
reacquires the lock via leave_blocking_section and releases it after 
(or a signal handler could be executing caml code concurrently with a 


P.S. In your previous post is not clear to me what you are actually 
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: