Skip to main content

Package for using processes which mimics the threading module

Project description

Package for using processes which mimics the threading module, and allows the sharing of objects between processes. Communication between processes happens via sockets or (on Windows) named pipes.

The processing.Process class follows the API of threading.Thread. One can also use a manager to create shared objects. The types supported by default are

Lock, RLock, Condition, Event, Semaphore,
BoundedSemaphore, Queue, list, dict, Namespace.

For example:

>>> from processing import Manager
>>> manager = Manager()
>>> l = manager.list(range(10))
>>> l.reverse()
>>> print l
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
>>> print repr(l)
<Proxy[list] object at 0x00E1B3B0>

After installation you can run the test scripts by doing either

python -m processing.test

on Python 2.5 or

python -c "from processing.test import main; main()"

on earlier versions. This will run each test script twice: once using processes and once using threads.

See README.txt and doc/index.html for more information.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page