[issue8037] multiprocessing.Queue's put() not atomic thread wise

2011-10-06 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Modifying an object which is already on a traditional queue can also change what is received by the other thread (depending on timing). So Queue.Queue's put() is not atomic either. Therefore I do not believe this behaviour is a

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2011-08-29 Thread sbt
sbt shibt...@gmail.com added the comment: Modifying an object which is already on a traditional queue can also change what is received by the other thread (depending on timing). So Queue.Queue's put() is not atomic either. Therefore I do not believe this behaviour is a bug. However the

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2011-08-29 Thread sbt
sbt shibt...@gmail.com added the comment: I meant Issue 6721 (Locks in python standard library should be sanitized on fork) not 6271. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-11-02 Thread Ask Solem
Ask Solem a...@opera.com added the comment: Pickling on put makes sense to me. I can't think of cases where this could break existing code either. I think this may also resolve issue 8323 -- stage: - unit test needed ___ Python tracker

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-11-02 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Please find attached an updated patch (including unit test) for the release27-maint branch. I've run the test_multiprocessing suite against svn revision 86129 of said branch. -- Added file:

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-10-24 Thread Ask Solem
Ask Solem a...@opera.com added the comment: AFAICS the object will be pickled twice with this patch. See Modules/_multiprocessing/connection.h: connection_send_obj. -- nosy: +asksol ___ Python tracker rep...@bugs.python.org

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-10-24 Thread Ask Solem
Ask Solem a...@opera.com added the comment: aha, no. I see now you use connection.send_bytes instead. Then I can't think of any issues with this patch, but I don't know why it was done this way in the first place. -- ___ Python tracker

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-10-24 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: The idea is to pickle the object immediately (i.e. when added) instead of when requested (dequeued). This means that any operations (even deletion) performed on the original object do not make changes to the item in the queue,

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-04-30 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: -- versions: +Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___ ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Removed file: http://bugs.python.org/file16473/queues.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Updated patch to include new test (now against release26-maint branch). Verified test_multiprocessing suite passes before (apart from new test) after change. (Tested under Ubuntu 9.10 64-bit) -- Added file:

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Removed file: http://bugs.python.org/file16415/pickle_suggestion_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Updated patch to include new test (now against release26-maint branch). Verified test_multiprocessing suite passes before (apart from new test) after change. (Tested under Ubuntu 9.10 64-bit) -- Added file:

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Removed file: http://bugs.python.org/file16472/queues.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-06 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Added file: http://bugs.python.org/file16475/queues.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: I couldn't see the wood for the trees: If put() is thread-blocking, multiprocessing.Queue is reduced to the same functionality as multiprocessing.queues.SimpleQueue, if I'm not mistaken. So maybe there should be a warning in the

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Removed file: http://bugs.python.org/file16412/lock_suggestion.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Removed file: http://bugs.python.org/file16409/queue_example.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Added file: http://bugs.python.org/file16413/queue_example.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Alternative suggestion (since SimpleQueue doesn't provide buffering): Allow option to force immediate pickling of the object to be en-queued, i.e. pickling when adding to internal buffer instead of as part of Connection.send()

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Performance comparison before/after suggested change (adding/removing 1000-item list 1 times). Inline 1.926 class 'multiprocessing.queues.Queue' 1.919 class 'queues_pickled.Queue' 1.907 class 'queues_pickled.Queue'

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Removed file: http://bugs.python.org/file16414/pickle_suggestion.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-02 Thread Vilnis Termanis
Changes by Vilnis Termanis vilnis.terma...@googlemail.com: Added file: http://bugs.python.org/file16416/queue_perf.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8037 ___

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-01 Thread Vilnis Termanis
New submission from Vilnis Termanis vilnis.terma...@googlemail.com: If an object, which as been put() in the multiprocessing.Queue is changed immediately after the put() call then changed version may be added to the queue which I assume is not the expected behaviour: from multiprocessing

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-01 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: More notes: - Reason for non-atmoic behaviour is due to queue _feeder thread sending the object after the put() method has already exited. Hence changing the object straight after put() can result in the modified object being

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-01 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Quick though (last one I promise): Maybe put() could have an argument to indicate whether to be thread-blocking (i.e. guaranteeing the object to be sent in its current state) or not. The (current) non-thread-blocking mode will

[issue8037] multiprocessing.Queue's put() not atomic thread wise

2010-03-01 Thread Vilnis Termanis
Vilnis Termanis vilnis.terma...@googlemail.com added the comment: Hi Meador, I apologise: I really shouldn't have called it a patch. It's just to show one way that I've found fixes the problem (but presumably reduces performance in other cases, hence the suggestion wait for feedback on the