New submission from Kristján Valur Jónsson <krist...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue8777>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to