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
19f72e77
Commit
19f72e77
authored
Nov 22, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix two mp doc issues from #4012.
parent
5fbc2f2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Doc/library/multiprocessing.rst
Doc/library/multiprocessing.rst
+4
-4
No files found.
Doc/library/multiprocessing.rst
View file @
19f72e77
...
...
@@ -232,7 +232,7 @@ For example::
if __name__ == '
__main__
':
pool = Pool(processes=4) # start 4 worker processes
result = pool.apply
Async(f, [10])
# evaluate "f(10)" asynchronously
result = pool.apply
_async(f, [10])
# evaluate "f(10)" asynchronously
print(result.get(timeout=1)) # prints "100" unless your computer is *very* slow
print(pool.map(f, range(10))) # prints "[0, 1, 4,..., 81]"
...
...
@@ -1505,7 +1505,7 @@ with the :class:`Pool` class.
The
class
of
the
result
returned
by
:
meth
:`
Pool
.
apply_async
`
and
:
meth
:`
Pool
.
map_async
`.
..
method
::
get
([
timeout
)
..
method
::
get
([
timeout
]
)
Return
the
result
when
it
arrives
.
If
*
timeout
*
is
not
``
None
``
and
the
result
does
not
arrive
within
*
timeout
*
seconds
then
...
...
@@ -1535,7 +1535,7 @@ The following example demonstrates the use of a pool::
if
__name__
==
'__main__'
:
pool
=
Pool
(
processes
=
4
)
#
start
4
worker
processes
result
=
pool
.
apply
Async
(
f
,
(
10
,))
#
evaluate
"f(10)"
asynchronously
result
=
pool
.
apply
_async
(
f
,
(
10
,))
#
evaluate
"f(10)"
asynchronously
print
(
result
.
get
(
timeout
=
1
))
#
prints
"100"
unless
your
computer
is
*
very
*
slow
print
(
pool
.
map
(
f
,
range
(
10
)))
#
prints
"[0, 1, 4,..., 81]"
...
...
@@ -1546,7 +1546,7 @@ The following example demonstrates the use of a pool::
print
(
it
.
next
(
timeout
=
1
))
#
prints
"4"
unless
your
computer
is
*
very
*
slow
import
time
result
=
pool
.
apply
A
sync
(
time
.
sleep
,
(
10
,))
result
=
pool
.
apply
_a
sync
(
time
.
sleep
,
(
10
,))
print
(
result
.
get
(
timeout
=
1
))
#
raises
TimeoutError
...
...
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