processing is a package for the Python language which supports the spawning of processes using the API of the standard library’s threading module. It runs on both Unix and Windows.
Features:
Objects can be transferred between processes using pipes or multi-producer/multi-consumer queues.
Objects can be shared between processes using a server process or (for simple data) shared memory.
Equivalents of all the synchronization primitives in threading are available.
A Pool class makes it easy to submit tasks to a pool of worker processes.
Links
The project is hosted at
The package can be downloaded from
Examples
The processing.Process class follows the API of threading.Thread. For example
from processing import Process, Queue
def f(q):
q.put('hello world')
if __name__ == '__main__':
q = Queue()
p = Process(target=f, args=[q])
p.start()
print q.get()
p.join()
Synchronization primitives like locks, semaphores and conditions are available, for example
>>> from processing import Condition >>> c = Condition() >>> print c <Condition(<RLock(None, 0)>), 0> >>> c.acquire() True >>> print c <Condition(<RLock(MainProcess, 1)>), 0>
One can also use a manager to create shared objects either in shared memory or in a server process, 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>
Tasks can be offloaded to a pool of worker processes in various ways, for example
>>> from processing import Pool >>> def f(x): return x*x ... >>> p = Pool(4) >>> result = p.map_async(f, range(10)) >>> print result.get(timeout=1) [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Release files for processing 0.39
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| processing-0.39.zip | 163.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| processing-0.39.win32-py2.5.exe | Details | |||
| processing-0.39.win32-py2.4.exe | Details |
Total release size: 528.4 kB
Release files / processing-0.39.zip
| Download URL | processing-0.39.zip |
|---|---|
| Size | 163.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c4cdfa49caaeb852198a7bc03b95386710810962d1463d925acbd85c3021b71
|
|
BLAKE2b-256 checksum How to use checksums |
bf042716b35eec738da2f8815b6b15ca17909962d73ba1527a3d7c30569f0b0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / processing-0.39.win32-py2.5.exe
| Download URL | processing-0.39.win32-py2.5.exe |
|---|---|
| Size | 183.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2731425fee97d6eb284d61c8efff182b7a4647412389a864e2c23479d48af3b
|
|
BLAKE2b-256 checksum How to use checksums |
b490f37404769f328c44172086b1c7acd7da6b1cfea5e072012f2775c22f8fba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / processing-0.39.win32-py2.4.exe
| Download URL | processing-0.39.win32-py2.4.exe |
|---|---|
| Size | 181.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01451b99cba0295e75bd2faaa1da1e5b7fa55ec9398362dd0a25067c82a77447
|
|
BLAKE2b-256 checksum How to use checksums |
60f5a91440382ae013f42e4c78d95220cdd6648277aff641de40fd822ef68808
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |