caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Thread in OCaml
Date: Fri, 16 Apr 2004 13:23:41 +0200	[thread overview]
Message-ID: <83FD8472-8F98-11D8-9A79-000393DBC266@epfl.ch> (raw)
In-Reply-To: <407FB5BA.10607@univ-savoie.fr>


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 
callback).

Daniel

P.S. In your previous post is not clear to me what you are actually 
measuring.
-------------------
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


  reply	other threads:[~2004-04-16 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16 10:30 Christophe Raffalli
2004-04-16 11:23 ` Daniel Bünzli [this message]
2004-04-16 16:15 ` Damien Doligez
2004-04-17  1:03   ` Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83FD8472-8F98-11D8-9A79-000393DBC266@epfl.ch \
    --to=daniel.buenzli@epfl.ch \
    --cc=Christophe.Raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).