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.

classification
Title: Multiprocessing and UUID bug on Mac OSX
Type: Stage: resolved
Components: macOS Versions: Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: uuid.uuid4() generates non-unique values on OSX
View: 8621
Assigned To: ronaldoussoren Nosy List: Gavin.Roy, ronaldoussoren
Priority: normal Keywords:

Created on 2010-05-18 18:38 by Gavin.Roy, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (1)
msg105997 - (view) Author: Gavin Roy (Gavin.Roy) Date: 2010-05-18 18:38
import multiprocessing
import uuid

def test():
    print str(uuid.uuid4())

p = multiprocessing.Pool(processes=4)
for x in xrange(0, 4):
  p.apply_async(test)

In MacOS:

Gavin-M-Roys-Office-iMac:kvpbench gmr$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> import multiprocessing
>>> import uuid
>>> 
>>> def test():
...     print str(uuid.uuid4())
... 
>>> p = multiprocessing.Pool(processes=4)
>>> for x in xrange(0, 4):
...   p.apply_async(test)
... 
<multiprocessing.pool.ApplyResult object at 0x10056bb90>
<multiprocessing.pool.ApplyResult object at 0x10064e690>
<multiprocessing.pool.ApplyResult object at 0x10064e750>
<multiprocessing.pool.ApplyResult object at 0x10064e710>
>>> 62c76035-e340-41c4-86b4-908660b73bb7
62c76035-e340-41c4-86b4-908660b73bb7
62c76035-e340-41c4-86b4-908660b73bb7
62c76035-e340-41c4-86b4-908660b73bb7

In Linux:

gmr@binti ~ $ python
Python 2.6.4 (r264:75706, Mar  9 2010, 17:27:45) 
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> import uuid
>>> 
>>> def test():
...     print str(uuid.uuid4())
... 
>>> p = multiprocessing.Pool(processes=4)
>>> for x in xrange(0, 4):
...   p.apply_async(test)
... 
<multiprocessing.pool.ApplyResult object at 0x7dd990>
<multiprocessing.pool.ApplyResult object at 0x86d310>
<multiprocessing.pool.ApplyResult object at 0x86d390>
<multiprocessing.pool.ApplyResult object at 0x86d410>
>>> 6121782c-008d-42db-9df5-bbf619fb6568
ee7d3ef8-1c54-4ab5-bf06-1eddf5bcf2cb
40efe282-65a5-4160-96ee-b4cc0d14029d
9eb799f2-a46c-41e8-901f-423177f3467d
History
Date User Action Args
2022-04-11 14:57:01adminsetgithub: 53002
2010-05-18 18:52:59r.david.murraysetstatus: open -> closed
resolution: duplicate
superseder: uuid.uuid4() generates non-unique values on OSX
stage: resolved
2010-05-18 18:38:15Gavin.Roycreate