Jyotirmoy Bhattacharya added the comment: > > A return value from clear will indicate to a thread if it > > won the race to clear the event. > > Why would we care who won the race to clear? I would think that the > important thing is that the event is cleared, not who did it. >
Here's the scenario that prompted my report: the Event is set to indicate that certain 'work' has accumulated and one among a pool of workers uses clear() to claim the work accumulated till that point. If clear() returned a value, we could easily ensure that only one among the workers woken up actually does the work. Of course, in this case it would be more efficient to wake up just one worker using a Condition object and notify() but then one has to write the logic to maintain the state of the event. An Event whose clear() returned a value would allow for a quick and dirty solution. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29449> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com