caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: Basile STARYNKEVITCH <basile@starynkevitch.net>
Cc: caml_list@inria.fr
Subject: Re: [Caml-list] recursive mutexes?
Date: Mon, 11 Nov 2002 10:55:40 +0100	[thread overview]
Message-ID: <20021111105540.B5171@pauillac.inria.fr> (raw)
In-Reply-To: <15819.54873.817342.980555@hector.lesours>; from basile@starynkevitch.net on Fri, Nov 08, 2002 at 04:20:57PM +0100

> Does the Mutex module allow "recursive" mutexes

No.  A thread blocks forever if it attempts to lock a mutex it already
locked before.

> (the reference manual is not fully clear on this, and
> it is an important point).

I agree the documentation should be clearer on this point.

> AFAIK some Posix threads accept recursive locking.

Some do, but the POSIX 1003.1c standard specifies non-recursive
mutexes only.  There are endless arguments on the usefulness/evilness
of recursive mutexes on comp.programming.threads; the jury is still
out on this one.  

Of course, it is not difficult to implement recursive mutexes yourself
on top of normal mutexes.  You won't be able to use your recursive
mutexes in conjunction with condition variables, though.

- Xavier Leroy
-------------------
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:[~2002-11-12  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08 15:20 Basile STARYNKEVITCH
2002-11-11  9:55 ` Xavier Leroy [this message]

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=20021111105540.B5171@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=basile@starynkevitch.net \
    --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).