[issue6721] Locks in python standard library should be sanitized on fork

Charles-François Natali report at bugs.python.org
Sat May 14 10:26:15 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

Hello Steffen,

First, thanks for testing this on OS-X: I only have access to Linux
systems (I tested both the semaphore and the emulated semaphore
paths).

If I understand correctly, the patch works fine with the default build
option on OS-X.
Then, you're saying that OS-X doesn't have POSIX unnamed semaphores:
this means that the default build uses the mutex+condition variable
version. Am I correct?
But I don't understand the last part of your message.
Do you mean that you implemented your own version of the semaphore
path using named semaphores, and that it fails with my patch (well,
your adapted version of it) ?
If yes, then you'll understand that I can't comment on this, since
it's not my code :-)
But after a quick look at the code you posted, I think that your
acquire code is broken:
sem_timedwait(timeout) if not the same as trying sem_trywait multiple
times until timeout expires: in case of contention, this will fail.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6721>
_______________________________________


More information about the Python-bugs-list mailing list