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 pitrou
Recipients neologix, pitrou, rhettinger
Date 2013-03-09.11:30:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362828616.74.0.550498126072.issue17385@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think you need slicing if you rewrite the patch in another way, e.g.:

for i in range(n):
    try:
        waiter = __waiters.popleft()
    except IndexError:
        break
    waiter.release()

I think this is safe, since notify() must be called with the lock held: another thread shouldn't be able to mutate the waiters list in the meantime.

As for notify_all(), it could be optimized to swap the internal list with an empty one: there's no need to pop the waiters one by one.
History
Date User Action Args
2013-03-09 11:30:16pitrousetrecipients: + pitrou, rhettinger, neologix
2013-03-09 11:30:16pitrousetmessageid: <1362828616.74.0.550498126072.issue17385@psf.upfronthosting.co.za>
2013-03-09 11:30:16pitroulinkissue17385 messages
2013-03-09 11:30:16pitroucreate