[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2019-08-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 35f6301d68bdb0517be284421782d64407dfe72c by Raymond Hettinger in 
branch 'master':
bpo-10978: Semaphores can release multiple threads at a time (GH-15588)
https://github.com/python/cpython/commit/35f6301d68bdb0517be284421782d64407dfe72c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2019-08-29 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2019-08-29 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
versions: +Python 3.9 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2019-08-29 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15264
pull_request: https://github.com/python/cpython/pull/15588

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2019-03-15 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2014-06-25 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Never know whether to comment on issue itself, but just in case:

There are issues with the patch when n  0 is passed, as n is not sanity 
checked, which would break the Semaphore invariant (value must be = 0). n == 0 
is also a weird value, but harmless if passed; release(0) would acquire and 
release the lock but otherwise act as a noop.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2014-06-24 Thread Josh Rosenberg

Changes by Josh Rosenberg shadowranger+pyt...@gmail.com:


--
nosy: +josh.rosenberg

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2014-06-22 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +neologix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2014-06-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Updated patch (with tests and docs).

--
nosy: +tim.peters
versions: +Python 3.5 -Python 3.3
Added file: http://bugs.python.org/file35718/multirelease.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2014-06-19 Thread Mark Lawrence

Mark Lawrence added the comment:

Seems good to proceed as there are no dissenters.

--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2011-05-02 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Your patch uses tabs for indentation. Otherwise, looks good on the principle.

--
nosy: +pitrou
stage:  - patch review
type: behavior - feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2011-03-23 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10978] Add optional argument to Semaphore.release for releasing multiple threads

2011-01-21 Thread Raymond Hettinger

New submission from Raymond Hettinger rhettin...@users.sourceforge.net:

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.

--
components: Library (Lib)
files: sem.diff
keywords: patch
messages: 126804
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Add optional argument to Semaphore.release for releasing multiple threads
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file20483/sem.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10978
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com