Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3a8ae5f9
Commit
3a8ae5f9
authored
Jan 11, 2011
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean-up threading.Barrier example.
parent
5cee47f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Doc/whatsnew/3.2.rst
Doc/whatsnew/3.2.rst
+7
-4
No files found.
Doc/whatsnew/3.2.rst
View file @
3a8ae5f9
...
@@ -846,7 +846,7 @@ Example of using barriers::
...
@@ -846,7 +846,7 @@ Example of using barriers::
summarize(ballots)
summarize(ballots)
all_polls_closed = Barrier(len(sites))
all_polls_closed = Barrier(len(sites))
for site in sites
(get_votes(site))
:
for site in sites:
Thread(target=get_votes, args=(site,)).start()
Thread(target=get_votes, args=(site,)).start()
In this example, the barrier enforces a rule that votes cannot be counted at any
In this example, the barrier enforces a rule that votes cannot be counted at any
...
@@ -856,10 +856,13 @@ and continue to do work (summarizing ballots) after the barrier point is
...
@@ -856,10 +856,13 @@ and continue to do work (summarizing ballots) after the barrier point is
crossed.
crossed.
See `Barrier Synchronization Patterns
See `Barrier Synchronization Patterns
<http://parlab.eecs.berkeley.edu/wiki/_media/patterns/paraplop_g1_3.pdf>`_
<http://parlab.eecs.berkeley.edu/wiki/_media/patterns/paraplop_g1_3.pdf>`_ for
for more examples of how barriers can be used in parallel computing.
more examples of how barriers can be used in parallel computing. Also, there is
a simple but thorough explanation of barriers in `The Little Book of Semaphores
<http://greenteapress.com/semaphores/downey08semaphores.pdf>`_, *section 3.6*.
(Contributed by Kristján Valur Jónsson in :issue:`8777`.)
(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin in
:issue:`8777`.)
datetime
datetime
--------
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment