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 rhettinger
Recipients rhettinger
Date 2011-01-22.00:15:33
SpamBayes Score 0.01483699
Marked as misclassified No
Message-id <1295655336.58.0.55708711889.issue10978@psf.upfronthosting.co.za>
In-reply-to
Content
Call sem.release(5) would have the same effect as:

with lock:
    for i in range(5):
         sem.release()

The use case is when a single semaphore is holding up multiple threads and needs to release them all.  According to "The Little Book of Semaphores <http://greenteapress.com/semaphores/>", this is a common design pattern.

Basic patch attached.  If the proposal meets with acceptance, will add tests and a doc update.
History
Date User Action Args
2011-01-22 00:15:36rhettingersetrecipients: + rhettinger
2011-01-22 00:15:36rhettingersetmessageid: <1295655336.58.0.55708711889.issue10978@psf.upfronthosting.co.za>
2011-01-22 00:15:34rhettingerlinkissue10978 messages
2011-01-22 00:15:33rhettingercreate