◐ Shell
clean mode source ↗

Message 161405 - Python tracker

> (1) Good catch. I suspect that this could be mitigated even if we cared 
> about LinuxThreads. I haven't looked, but there's got to be a way to 
> determine if we are a thread or a fork child.

Using a generation count would probably work just as well as the PID: main 
process has generation 0, children have generation 1, grandchildren have 
generation 2, ...

> (2) I think I didn't explain my idea very well. I don't mean that we 
> should release *all* locks on fork. That will end in disaster, as 
> Charles-François amply explained.

So what are you suggesting?  That a lock of the default type should raise
an error if you try to acquire it when it has been acquired in a previous
process?