This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author schlesin
Recipients schlesin
Date 2009-10-09.23:13:16
SpamBayes Score 0.0002658479
Marked as misclassified No
Message-id <1255129998.33.0.0350728578751.issue7095@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation for the Multiprocessing.Array says:

multiprocessing.Array(typecode_or_type, size_or_initializer, *,
lock=True)¶

...
If lock is False then access to the returned object will not be
automatically protected by a lock, so it will not necessarily be
“process-safe”.
...

However:
In [48]: mp.Array('i',1,lock=False)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call
last)

/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
multiprocessing/__init__.pyc in Array(typecode_or_type,
size_or_initializer, **kwds)
    252     '''
    253     from multiprocessing.sharedctypes import Array
--> 254     return Array(typecode_or_type, size_or_initializer,
**kwds)
    255
    256 #

/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
multiprocessing/sharedctypes.pyc in Array(typecode_or_type,
size_or_initializer, **kwds)
     85     if lock is None:
     86         lock = RLock()
---> 87     assert hasattr(lock, 'acquire')
     88     return synchronized(obj, lock)
     89

AssertionError:

-------
I.e. it looks like lock=False is not actually supported.
History
Date User Action Args
2009-10-09 23:13:18schlesinsetrecipients: + schlesin
2009-10-09 23:13:18schlesinsetmessageid: <1255129998.33.0.0350728578751.issue7095@psf.upfronthosting.co.za>
2009-10-09 23:13:17schlesinlinkissue7095 messages
2009-10-09 23:13:16schlesincreate