Author sbt
Recipients Sebastian.Noack, asvetlov, christian.heimes, jyasskin, kristjan.jonsson, mklauber, neologix, pitrou, sbt
Date 2012-10-04.16:55:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349369759.38.0.440142405873.issue8800@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is a new version of Kristjan's patch with support for managers.  (A threading._RWLockCore object is proxied and wrapped in a local instance of a subclass of threading.RWLock.)

Also I made multiprocessing.RWLock.__init__() use multiprocessing.util.register_after_fork() to clear self._owners.  Otherwise on Unix you can run into trouble if a forked processes starts a new thread whose id was in self._owners at the time of the fork.

I found that test_many_readers() and test_recursion() tended to fail when run with processes (on Windows).  This is because starting a process on Windows is slow, particularly with a debug build.  (Some of the buildbots running Windows in a VM can be crazily slow.)  Each reader only held the lock for 0.02 secs which is much less than the time to start a process on Windows.  This meant that it was easy to never have overlapping ownership, causing the tests to fail.

I fixed this by starting the readers while holding an exclusive, waiting for period, and then releasing the exclusive lock.  This makes it possible to change

    self.assertTrue(max(nlocked) > 1)

to

    self.assertEqual(max(nlocked), N)

Choosing timeouts to keep the buildbots happy can be a pain:-(
History
Date User Action Args
2012-10-04 16:56:00sbtsetrecipients: + sbt, pitrou, kristjan.jonsson, christian.heimes, jyasskin, asvetlov, neologix, mklauber, Sebastian.Noack
2012-10-04 16:55:59sbtsetmessageid: <1349369759.38.0.440142405873.issue8800@psf.upfronthosting.co.za>
2012-10-04 16:55:59sbtlinkissue8800 messages
2012-10-04 16:55:58sbtcreate