Le lundi 01 février 2010 à 23:58 +0100, "Martin v. Löwis" a écrit : > > Interestingly, the POSIX pthread_atfork documentation defines how you > are supposed to do that: create an atfork handler set, and acquire all > mutexes in the prepare handler. Then fork, and have the parent and child > handlers release the locks. Of course, unless your locks are recursive, > you still have to know what locks you are already holding.
So, if we restrict ourselves to Python-level locks (thread.Lock and thread.RLock), I guess we could just chain them in a doubly-linked list and add an internal _PyThread_AfterFork() function? _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com