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 Gavin.Roy
Recipients Gavin.Roy, ronaldoussoren
Date 2010-05-18.18:38:14
SpamBayes Score 6.1831993e-06
Marked as misclassified No
Message-id <1274207897.31.0.857172476403.issue8756@psf.upfronthosting.co.za>
In-reply-to
Content
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
2010-05-18 18:38:17Gavin.Roysetrecipients: + Gavin.Roy, ronaldoussoren
2010-05-18 18:38:17Gavin.Roysetmessageid: <1274207897.31.0.857172476403.issue8756@psf.upfronthosting.co.za>
2010-05-18 18:38:15Gavin.Roylinkissue8756 messages
2010-05-18 18:38:14Gavin.Roycreate