Richard Oudkerk <shibt...@gmail.com> added the comment:

> a) fork() is called with the DB lock held by thread1.
> b) Some time passes before the child gets to exec().
> c) In that time, the child's thread2 gets to doWork(). 
> d) Simultaneously, the parent's doWork is still running and holding a lock.
> e) Thanks to reinit_locks, the child's thread2 does not have a lock, and 
> it will merrily proceed to corrupt the parent's work.

You seem to be saying that all three threads survive the fork.

I think forkall() on Solaris acts like that, but the normal fork() function 
does not.  Only the thread which performs fork() will survive in the child 
process.

So doWork() never runs in the child process, and the lock is never used in the 
child process.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6721>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to