This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbt
Recipients Sebastian.Noack, asvetlov, christian.heimes, jyasskin, kristjan.jonsson, mklauber, neologix, pitrou, sbt
Date 2012-10-02.10:44:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349174659.73.0.190104850809.issue8800@psf.upfronthosting.co.za>
In-reply-to
Content
> I think you got that argument backwards.  The simple greedy policy you 
> implement works well provided there are not too many readers. Otherwise, 
> the writers will be starved, since they have to wait for an oppertune 
> moment when no readers are active to get a foot in the door, so to speak.

Actually, I think Sebastian's algorithm attempts to be fair to both readers and writers.

If there is a writer waiting then "self._wait_count > self._granted_count".  The writer cannot be prempted by a later reader because the reader would find "waitno > self._granted_count" until after writer has been granted the lock.
History
Date User Action Args
2012-10-02 10:44:19sbtsetrecipients: + sbt, pitrou, kristjan.jonsson, christian.heimes, jyasskin, asvetlov, neologix, mklauber, Sebastian.Noack
2012-10-02 10:44:19sbtsetmessageid: <1349174659.73.0.190104850809.issue8800@psf.upfronthosting.co.za>
2012-10-02 10:44:19sbtlinkissue8800 messages
2012-10-02 10:44:19sbtcreate