Message80162
Objects contained in a multiprocessing.Queue object are not comming out
of the queue in the same order as they went in. For instance, if I put
in object1, object2 and object3 in this very time sequence from multiple
processes, they can end up comming out of the queue as object2, object1
then object3 instead of the original order.
When using the threading module instead of multiprocessing everything is
fine.
The provided test script adds strings to the queue with timestamps.
These messages are not ordered by timestamp when they are printed. This
is an output of the test script with format "[pid@time] message":
[2120@00406] Got lock
[2120@02424] Released lock
[2121@02426] Got lock
[2121@04439] Released lock
[...]
[2121@16459] Released lock
[2120@16461] Got lock
[2121@18464] Got lock
[2120@18462] Released lock
[2121@20466] Released lock
Using print to print the message immediatly prints the messages in the
right order.
See this mailing-list thread for details:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/11a5c4ce4ff4382d/033dcd3607eacbf9 |
|
Date |
User |
Action |
Args |
2009-01-19 12:57:25 | ndfred | set | recipients:
+ ndfred |
2009-01-19 12:57:25 | ndfred | set | messageid: <1232369845.16.0.0391307501892.issue4999@psf.upfronthosting.co.za> |
2009-01-19 12:57:24 | ndfred | link | issue4999 messages |
2009-01-19 12:57:23 | ndfred | create | |
|