Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9290503b
Kaydet (Commit)
9290503b
authored
Kas 22, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#4206: fix 2.xisms in multiprocessing docs and docstrings.
üst
59d64f78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
multiprocessing.rst
Doc/library/multiprocessing.rst
+3
-3
pool.py
Lib/multiprocessing/pool.py
+8
-7
No files found.
Doc/library/multiprocessing.rst
Dosyayı görüntüle @
9290503b
...
@@ -1447,8 +1447,8 @@ with the :class:`Pool` class.
...
@@ -1447,8 +1447,8 @@ with the :class:`Pool` class.
..
method
::
map
(
func
,
iterable
[,
chunksize
])
..
method
::
map
(
func
,
iterable
[,
chunksize
])
A
parallel
equivalent
of
the
:
func
:`
map
`
builtin
function
.
It
blocks
till
A
parallel
equivalent
of
the
:
func
:`
map
`
builtin
function
,
collecting
the
th
e
result
is
ready
.
result
in
a
list
.
It
blocks
till
the
whol
e
result
is
ready
.
This
method
chops
the
iterable
into
a
number
of
chunks
which
it
submits
to
This
method
chops
the
iterable
into
a
number
of
chunks
which
it
submits
to
the
process
pool
as
separate
tasks
.
The
(
approximate
)
size
of
these
the
process
pool
as
separate
tasks
.
The
(
approximate
)
size
of
these
...
@@ -1465,7 +1465,7 @@ with the :class:`Pool` class.
...
@@ -1465,7 +1465,7 @@ with the :class:`Pool` class.
..
method
::
imap
(
func
,
iterable
[,
chunksize
])
..
method
::
imap
(
func
,
iterable
[,
chunksize
])
A
n
lazier
version
of
:
meth
:`
map
`.
A
lazier
version
of
:
meth
:`
map
`.
The
*
chunksize
*
argument
is
the
same
as
the
one
used
by
the
:
meth
:`.
map
`
The
*
chunksize
*
argument
is
the
same
as
the
one
used
by
the
:
meth
:`.
map
`
method
.
For
very
long
iterables
using
a
large
value
for
*
chunksize
*
can
method
.
For
very
long
iterables
using
a
large
value
for
*
chunksize
*
can
...
...
Lib/multiprocessing/pool.py
Dosyayı görüntüle @
9290503b
...
@@ -76,7 +76,7 @@ def worker(inqueue, outqueue, initializer=None, initargs=()):
...
@@ -76,7 +76,7 @@ def worker(inqueue, outqueue, initializer=None, initargs=()):
class
Pool
(
object
):
class
Pool
(
object
):
'''
'''
Class which supports an async version of
the `apply()` builtin
Class which supports an async version of
applying functions to arguments.
'''
'''
Process
=
Process
Process
=
Process
...
@@ -135,21 +135,22 @@ class Pool(object):
...
@@ -135,21 +135,22 @@ class Pool(object):
def
apply
(
self
,
func
,
args
=
(),
kwds
=
{}):
def
apply
(
self
,
func
,
args
=
(),
kwds
=
{}):
'''
'''
Equivalent of `
apply()` builtin
Equivalent of `
func(*args, **kwds)`.
'''
'''
assert
self
.
_state
==
RUN
assert
self
.
_state
==
RUN
return
self
.
apply_async
(
func
,
args
,
kwds
)
.
get
()
return
self
.
apply_async
(
func
,
args
,
kwds
)
.
get
()
def
map
(
self
,
func
,
iterable
,
chunksize
=
None
):
def
map
(
self
,
func
,
iterable
,
chunksize
=
None
):
'''
'''
Equivalent of `map()` builtin
Apply `func` to each element in `iterable`, collecting the results
in a list that is returned.
'''
'''
assert
self
.
_state
==
RUN
assert
self
.
_state
==
RUN
return
self
.
map_async
(
func
,
iterable
,
chunksize
)
.
get
()
return
self
.
map_async
(
func
,
iterable
,
chunksize
)
.
get
()
def
imap
(
self
,
func
,
iterable
,
chunksize
=
1
):
def
imap
(
self
,
func
,
iterable
,
chunksize
=
1
):
'''
'''
Equivalent of `
itertool.imap()` -- can be MUCH slower than `Pool.map()`
Equivalent of `
map()` -- can be MUCH slower than `Pool.map()`.
'''
'''
assert
self
.
_state
==
RUN
assert
self
.
_state
==
RUN
if
chunksize
==
1
:
if
chunksize
==
1
:
...
@@ -167,7 +168,7 @@ class Pool(object):
...
@@ -167,7 +168,7 @@ class Pool(object):
def
imap_unordered
(
self
,
func
,
iterable
,
chunksize
=
1
):
def
imap_unordered
(
self
,
func
,
iterable
,
chunksize
=
1
):
'''
'''
Like `imap()` method but ordering of results is arbitrary
Like `imap()` method but ordering of results is arbitrary
.
'''
'''
assert
self
.
_state
==
RUN
assert
self
.
_state
==
RUN
if
chunksize
==
1
:
if
chunksize
==
1
:
...
@@ -185,7 +186,7 @@ class Pool(object):
...
@@ -185,7 +186,7 @@ class Pool(object):
def
apply_async
(
self
,
func
,
args
=
(),
kwds
=
{},
callback
=
None
):
def
apply_async
(
self
,
func
,
args
=
(),
kwds
=
{},
callback
=
None
):
'''
'''
Asynchronous
equivalent of `apply()` builtin
Asynchronous
version of `apply()` method.
'''
'''
assert
self
.
_state
==
RUN
assert
self
.
_state
==
RUN
result
=
ApplyResult
(
self
.
_cache
,
callback
)
result
=
ApplyResult
(
self
.
_cache
,
callback
)
...
@@ -194,7 +195,7 @@ class Pool(object):
...
@@ -194,7 +195,7 @@ class Pool(object):
def
map_async
(
self
,
func
,
iterable
,
chunksize
=
None
,
callback
=
None
):
def
map_async
(
self
,
func
,
iterable
,
chunksize
=
None
,
callback
=
None
):
'''
'''
Asynchronous
equivalent of `map()` builtin
Asynchronous
version of `map()` method.
'''
'''
assert
self
.
_state
==
RUN
assert
self
.
_state
==
RUN
if
not
hasattr
(
iterable
,
'__len__'
):
if
not
hasattr
(
iterable
,
'__len__'
):
...
...
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