[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Recursive mutexes?
From: |
Marius Vollmer |
Subject: |
Recursive mutexes? |
Date: |
26 Oct 2002 22:35:58 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Our current coop mutexes are not 'recursive'. This means that a
thread blocks when it tries to lock a mutex that it already has
locked.
I think we should make our mutexes be recursive by default. Expecting
to block when locking a mutex that is already lcoked by one self is
not very useful, since no one can unlock that mutex (excepts asyncs).
The only good argument against recursive mutexes that I can think of
is a tiny performance gain since you don't need to do some checking.
SRFI-18 specifies non-recursive mutexes and allows non-owning threads
to unlock a mutex. Such uses of a mutex are, in my view, a mockery of
condition variables should be avoided.
If non-recursive mutexes turn out to be important, we can provide them
as well, as an option.
Ok?
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
- Recursive mutexes?,
Marius Vollmer <=
Re: Recursive mutexes?, Rob Browning, 2002/10/26