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 sbt
Recipients Olivier.Grisel, jnoller, lars, python-dev, sbt
Date 2013-10-19.22:28:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382221730.1.0.740227360548.issue18999@psf.upfronthosting.co.za>
In-reply-to
Content
I guess this should be clarified in the docs, but multiprocessing.pool.Pool is a *class* whose constructor takes a context argument, where as multiprocessing.Pool() is a *bound method* of the default context.  (In previous versions multiprocessing.Pool was a *function*.)

The only reason you might need the context argument is if you have subclassed multiprocessing.pool.Pool.

>>> from multiprocessing import pool, get_context
>>> forkserver = get_context('forkserver')
>>> p = forkserver.Pool()
>>> q = pool.Pool(context=forkserver)
>>> p, q
(<multiprocessing.pool.Pool object at 0xb71f3eec>, <multiprocessing.pool.Pool object at 0xb6edb06c>)

I suppose we could just make the bound methods accept a context argument which (if not None) is used instead of self.
History
Date User Action Args
2013-10-19 22:28:50sbtsetrecipients: + sbt, jnoller, python-dev, lars, Olivier.Grisel
2013-10-19 22:28:50sbtsetmessageid: <1382221730.1.0.740227360548.issue18999@psf.upfronthosting.co.za>
2013-10-19 22:28:50sbtlinkissue18999 messages
2013-10-19 22:28:50sbtcreate