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
6ab22154
Kaydet (Commit)
6ab22154
authored
Ock 18, 2009
tarafından
Jesse Noller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolve issue 4449: AssertionError in mp_benchmarks.py
üst
b746448f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
+30
-9
multiprocessing.rst
Doc/library/multiprocessing.rst
+3
-3
sharedctypes.py
Lib/multiprocessing/sharedctypes.py
+10
-4
test_multiprocessing.py
Lib/test/test_multiprocessing.py
+14
-2
NEWS
Misc/NEWS
+3
-0
No files found.
Doc/library/multiprocessing.rst
Dosyayı görüntüle @
6ab22154
...
@@ -880,7 +880,7 @@ Shared :mod:`ctypes` Objects
...
@@ -880,7 +880,7 @@ Shared :mod:`ctypes` Objects
It
is
possible
to
create
shared
objects
using
shared
memory
which
can
be
It
is
possible
to
create
shared
objects
using
shared
memory
which
can
be
inherited
by
child
processes
.
inherited
by
child
processes
.
..
function
::
Value
(
typecode_or_type
[,
*
args
,
lock
]
])
..
function
::
Value
(
typecode_or_type
,
*
args
[,
lock
])
Return
a
:
mod
:`
ctypes
`
object
allocated
from
shared
memory
.
By
default
the
Return
a
:
mod
:`
ctypes
`
object
allocated
from
shared
memory
.
By
default
the
return
value
is
actually
a
synchronized
wrapper
for
the
object
.
return
value
is
actually
a
synchronized
wrapper
for
the
object
.
...
@@ -962,7 +962,7 @@ processes.
...
@@ -962,7 +962,7 @@ processes.
*
typecode_or_type
*
determines
the
type
of
the
returned
object
:
it
is
either
a
*
typecode_or_type
*
determines
the
type
of
the
returned
object
:
it
is
either
a
ctypes
type
or
a
one
character
typecode
of
the
kind
used
by
the
:
mod
:`
array
`
ctypes
type
or
a
one
character
typecode
of
the
kind
used
by
the
:
mod
:`
array
`
module
.
*
/
*
args
*
is
passed
on
to
the
constructor
for
the
type
.
module
.
*
\
*
args
*
is
passed
on
to
the
constructor
for
the
type
.
Note
that
setting
and
getting
the
value
is
potentially
non
-
atomic
--
use
Note
that
setting
and
getting
the
value
is
potentially
non
-
atomic
--
use
:
func
:`
Value
`
instead
to
make
sure
that
access
is
automatically
synchronized
:
func
:`
Value
`
instead
to
make
sure
that
access
is
automatically
synchronized
...
@@ -972,7 +972,7 @@ processes.
...
@@ -972,7 +972,7 @@ processes.
attributes
which
allow
one
to
use
it
to
store
and
retrieve
strings
--
see
attributes
which
allow
one
to
use
it
to
store
and
retrieve
strings
--
see
documentation
for
:
mod
:`
ctypes
`.
documentation
for
:
mod
:`
ctypes
`.
..
function
::
Array
(
typecode_or_type
,
size_or_initializer
[,
*
args
[,
lock
]
])
..
function
::
Array
(
typecode_or_type
,
size_or_initializer
,
*
args
[,
lock
])
The
same
as
:
func
:`
RawArray
`
except
that
depending
on
the
value
of
*
lock
*
a
The
same
as
:
func
:`
RawArray
`
except
that
depending
on
the
value
of
*
lock
*
a
process
-
safe
synchronization
wrapper
may
be
returned
instead
of
a
raw
ctypes
process
-
safe
synchronization
wrapper
may
be
returned
instead
of
a
raw
ctypes
...
...
Lib/multiprocessing/sharedctypes.py
Dosyayı görüntüle @
6ab22154
...
@@ -69,9 +69,12 @@ def Value(typecode_or_type, *args, **kwds):
...
@@ -69,9 +69,12 @@ def Value(typecode_or_type, *args, **kwds):
if
kwds
:
if
kwds
:
raise
ValueError
(
'unrecognized keyword argument(s):
%
s'
%
kwds
.
keys
())
raise
ValueError
(
'unrecognized keyword argument(s):
%
s'
%
kwds
.
keys
())
obj
=
RawValue
(
typecode_or_type
,
*
args
)
obj
=
RawValue
(
typecode_or_type
,
*
args
)
if
lock
is
None
:
if
lock
is
False
:
return
obj
if
lock
in
(
True
,
None
):
lock
=
RLock
()
lock
=
RLock
()
assert
hasattr
(
lock
,
'acquire'
)
if
not
hasattr
(
lock
,
'acquire'
):
raise
AttributeError
(
"'
%
r' has no method 'acquire'"
%
lock
)
return
synchronized
(
obj
,
lock
)
return
synchronized
(
obj
,
lock
)
def
Array
(
typecode_or_type
,
size_or_initializer
,
**
kwds
):
def
Array
(
typecode_or_type
,
size_or_initializer
,
**
kwds
):
...
@@ -82,9 +85,12 @@ def Array(typecode_or_type, size_or_initializer, **kwds):
...
@@ -82,9 +85,12 @@ def Array(typecode_or_type, size_or_initializer, **kwds):
if
kwds
:
if
kwds
:
raise
ValueError
(
'unrecognized keyword argument(s):
%
s'
%
kwds
.
keys
())
raise
ValueError
(
'unrecognized keyword argument(s):
%
s'
%
kwds
.
keys
())
obj
=
RawArray
(
typecode_or_type
,
size_or_initializer
)
obj
=
RawArray
(
typecode_or_type
,
size_or_initializer
)
if
lock
is
None
:
if
lock
is
False
:
return
obj
if
lock
in
(
True
,
None
):
lock
=
RLock
()
lock
=
RLock
()
assert
hasattr
(
lock
,
'acquire'
)
if
not
hasattr
(
lock
,
'acquire'
):
raise
AttributeError
(
"'
%
r' has no method 'acquire'"
%
lock
)
return
synchronized
(
obj
,
lock
)
return
synchronized
(
obj
,
lock
)
def
copy
(
obj
):
def
copy
(
obj
):
...
...
Lib/test/test_multiprocessing.py
Dosyayı görüntüle @
6ab22154
...
@@ -829,10 +829,16 @@ class _TestValue(BaseTestCase):
...
@@ -829,10 +829,16 @@ class _TestValue(BaseTestCase):
obj3
=
val3
.
get_obj
()
obj3
=
val3
.
get_obj
()
self
.
assertEqual
(
lock
,
lock3
)
self
.
assertEqual
(
lock
,
lock3
)
arr4
=
self
.
RawValue
(
'i'
,
5
)
arr4
=
self
.
Value
(
'i'
,
5
,
lock
=
False
)
self
.
assertFalse
(
hasattr
(
arr4
,
'get_lock'
))
self
.
assertFalse
(
hasattr
(
arr4
,
'get_lock'
))
self
.
assertFalse
(
hasattr
(
arr4
,
'get_obj'
))
self
.
assertFalse
(
hasattr
(
arr4
,
'get_obj'
))
self
.
assertRaises
(
AttributeError
,
self
.
Value
,
'i'
,
5
,
lock
=
'navalue'
)
arr5
=
self
.
RawValue
(
'i'
,
5
)
self
.
assertFalse
(
hasattr
(
arr5
,
'get_lock'
))
self
.
assertFalse
(
hasattr
(
arr5
,
'get_obj'
))
class
_TestArray
(
BaseTestCase
):
class
_TestArray
(
BaseTestCase
):
...
@@ -887,9 +893,15 @@ class _TestArray(BaseTestCase):
...
@@ -887,9 +893,15 @@ class _TestArray(BaseTestCase):
obj3
=
arr3
.
get_obj
()
obj3
=
arr3
.
get_obj
()
self
.
assertEqual
(
lock
,
lock3
)
self
.
assertEqual
(
lock
,
lock3
)
arr4
=
self
.
RawArray
(
'i'
,
range
(
10
)
)
arr4
=
self
.
Array
(
'i'
,
range
(
10
),
lock
=
False
)
self
.
assertFalse
(
hasattr
(
arr4
,
'get_lock'
))
self
.
assertFalse
(
hasattr
(
arr4
,
'get_lock'
))
self
.
assertFalse
(
hasattr
(
arr4
,
'get_obj'
))
self
.
assertFalse
(
hasattr
(
arr4
,
'get_obj'
))
self
.
assertRaises
(
AttributeError
,
self
.
Array
,
'i'
,
range
(
10
),
lock
=
'notalock'
)
arr5
=
self
.
RawArray
(
'i'
,
range
(
10
))
self
.
assertFalse
(
hasattr
(
arr5
,
'get_lock'
))
self
.
assertFalse
(
hasattr
(
arr5
,
'get_obj'
))
#
#
#
#
...
...
Misc/NEWS
Dosyayı görüntüle @
6ab22154
...
@@ -137,6 +137,9 @@ Core and Builtins
...
@@ -137,6 +137,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
in sharedctypes.py.
- Issue #1225107: inspect.isclass() returned True for instances with a custom
- Issue #1225107: inspect.isclass() returned True for instances with a custom
__getattr__.
__getattr__.
...
...
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