[New-bugs-announce] [issue8777] Add threading.Barrier

Kristján Valur Jónsson report at bugs.python.org
Thu May 20 19:07:42 CEST 2010


New submission from Kristján Valur Jónsson <kristjan at ccpgames.com>:

The "barrier" synchronization primitive is often very useful.  It is simpler to use than an Event, for example, when waiting for threads to start up, or to finish.
The patch contains a simple barrier implementation based on a Condition variable, for your perusal.

See http://en.wikipedia.org/wiki/Barrier_(computer_science) for info.

This particular implementation contains an important feature:  The ability to adjust the 'count' of the barrier.  This is useful in case a thread dies for some reason, to avoid a deadlock for the other threads.

There is still no documentation, since this is only a proposal, but there is a unittest.

----------
components: Library (Lib)
files: barrier.patch
keywords: patch, patch
messages: 106167
nosy: krisvale
priority: normal
severity: normal
status: open
title: Add threading.Barrier
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file17417/barrier.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8777>
_______________________________________


More information about the New-bugs-announce mailing list