Skip to main content

About Multiprocess

multiprocess is a fork of multiprocessing. multiprocess extends multiprocessing to provide enhanced serialization, using dill. multiprocess leverages multiprocessing to support the spawning of processes using the API of the Python standard library’s threading module. multiprocessing has been distributed as part of the standard library since Python 2.6.

multiprocess is part of pathos, a Python framework for heterogeneous computing. multiprocess is in active development, so any user feedback, bug reports, comments, or suggestions are highly appreciated. A list of issues is located at https://github.com/uqfoundation/multiprocess/issues, with a legacy list maintained at https://uqfoundation.github.io/project/pathos/query.

Major Features

multiprocess enables:

  • objects to be transferred between processes using pipes or multi-producer/multi-consumer queues

  • objects to be shared between processes using a server process or (for simple data) shared memory

multiprocess provides:

  • equivalents of all the synchronization primitives in threading

  • a Pool class to facilitate submitting tasks to worker processes

  • enhanced serialization, using dill

Current Release

The latest released version of multiprocess is available from:

https://pypi.org/project/multiprocess

multiprocess is distributed under a 3-clause BSD license, and is a fork of multiprocessing.

Development Version

You can get the latest development version with all the shiny new features at:

https://github.com/uqfoundation

If you have a new contribution, please submit a pull request.

Installation

multiprocess can be installed with pip:

$ pip install multiprocess

For Python 2, a C compiler is required to build the included extension module from source. Python 3 and binary installs do not require a C compiler.

Requirements

multiprocess requires:

  • python (or pypy), >=3.9

  • setuptools, >=42

  • dill, >=0.4.1

Basic Usage

The multiprocess.Process class follows the API of threading.Thread. For example

from multiprocess 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 multiprocess 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 multiprocess 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 multiprocess 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]

When dill is installed, serialization is extended to most objects, for example

>>> from multiprocess import Pool
>>> p = Pool(4)
>>> print (p.map(lambda x: (lambda y:y**2)(x) + x, xrange(10)))
[0, 2, 6, 12, 20, 30, 42, 56, 72, 90]

More Information

Probably the best way to get started is to look at the documentation at http://multiprocess.rtfd.io. Also see multiprocess.tests for scripts that demonstrate how multiprocess can be used to leverge multiple processes to execute Python in parallel. You can run the test suite with python -m multiprocess.tests. As multiprocess conforms to the multiprocessing interface, the examples and documentation found at http://docs.python.org/library/multiprocessing.html also apply to multiprocess if one will import multiprocessing as multiprocess. See https://github.com/uqfoundation/multiprocess/tree/master/py3.12/examples for a set of examples that demonstrate some basic use cases and benchmarking for running Python code in parallel. Please feel free to submit a ticket on github, or ask a question on stackoverflow (@Mike McKerns). If you would like to share how you use multiprocess in your work, please send an email (to mmckerns at uqfoundation dot org).

Citation

If you use multiprocess to do research that leads to publication, we ask that you acknowledge use of multiprocess by citing the following in your publication:

M.M. McKerns, L. Strand, T. Sullivan, A. Fang, M.A.G. Aivazis,
"Building a framework for predictive science", Proceedings of
the 10th Python in Science Conference, 2011;
http://arxiv.org/pdf/1202.1056

Michael McKerns and Michael Aivazis,
"pathos: a framework for heterogeneous computing", 2010- ;
https://uqfoundation.github.io/project/pathos

Please see https://uqfoundation.github.io/project/pathos or http://arxiv.org/pdf/1202.1056 for further information.

Release files for multiprocess 0.70.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multiprocess 0.70.19
File Size Uploaded
multiprocess-0.70.19.tar.gz 2.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for multiprocess 0.70.19
File
multiprocess-0.70.19-py314-none-any.whl Python 3.14 none any Details
multiprocess-0.70.19-py313-none-any.whl Python 3.13 none any Details
multiprocess-0.70.19-py312-none-any.whl Python 3.12 none any Details
multiprocess-0.70.19-py311-none-any.whl Python 3.11 none any Details
multiprocess-0.70.19-py310-none-any.whl Python 3.10 none any Details
multiprocess-0.70.19-py39-none-any.whl Python 3.9 none any Details
multiprocess-0.70.19-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl PyPy 3.11 PyPy 3.11 7.3 Linux glibc 2.28+ x86-64 Details
multiprocess-0.70.19-pp311-pypy311_pp73-macosx_11_0_arm64.whl PyPy 3.11 PyPy 3.11 7.3 macOS 11.0+ ARM64 Details
multiprocess-0.70.19-pp311-pypy311_pp73-macosx_10_15_x86_64.whl PyPy 3.11 PyPy 3.11 7.3 macOS 10.15+ x86-64 Details
multiprocess-0.70.19-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl PyPy 3.10 PyPy 3.10 7.3 Linux glibc 2.28+ x86-64 Details
multiprocess-0.70.19-pp310-pypy310_pp73-macosx_11_0_arm64.whl PyPy 3.10 PyPy 3.10 7.3 macOS 11.0+ ARM64 Details
multiprocess-0.70.19-pp310-pypy310_pp73-macosx_10_15_x86_64.whl PyPy 3.10 PyPy 3.10 7.3 macOS 10.15+ x86-64 Details
multiprocess-0.70.19-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl PyPy 3.9 PyPy 3.9 7.3 Linux glibc 2.28+ x86-64 Details
multiprocess-0.70.19-pp39-pypy39_pp73-macosx_10_13_x86_64.whl PyPy 3.9 PyPy 3.9 7.3 macOS 10.13+ x86-64 Details
multiprocess-0.70.19-pp39-pypy39_pp73-macosx_10_13_arm64.whl PyPy 3.9 PyPy 3.9 7.3 macOS 10.13+ ARM64 Details

Total release size: 4.2 MB

Release files / multiprocess-0.70.19.tar.gz

Download URL multiprocess-0.70.19.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
952021e0e6c55a4a9fe4cd787895b86e239a40e76802a789d6305398d3975897
BLAKE2b-256 checksum
How to use checksums
a2f2e783ac7f2aeeed14e9e12801f22529cc7e6b7ab80928d6dcce4e9f00922d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-py314-none-any.whl

Download URL multiprocess-0.70.19-py314-none-any.whl
Size 160.3 kB
Tags Python 3.14
SHA-256 checksum
How to use checksums
e8cc7fbdff15c0613f0a1f1f8744bef961b0a164c0ca29bdff53e9d2d93c5e5f
BLAKE2b-256 checksum
How to use checksums
a061af9115673a5870fd885247e2f1b68c4f1197737da315b520a91c757a861a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-py313-none-any.whl

Download URL multiprocess-0.70.19-py313-none-any.whl
Size 156.4 kB
Tags Python 3.13
SHA-256 checksum
How to use checksums
8d5eb4ec5017ba2fab4e34a747c6d2c2b6fecfe9e7236e77988db91580ada952
BLAKE2b-256 checksum
How to use checksums
7f74d2c27e03cb84251dfe7249b8e82923643c6d48fa4883b9476b025e7dc7eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-py312-none-any.whl

Download URL multiprocess-0.70.19-py312-none-any.whl
Size 150.3 kB
Tags Python 3.12
SHA-256 checksum
How to use checksums
3a56c0e85dd5025161bac5ce138dcac1e49174c7d8e74596537e729fd5c53c28
BLAKE2b-256 checksum
How to use checksums
717038998b950a97ea279e6bd657575d22d1a2047256caf707d9a10fbce4f065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-py311-none-any.whl

Download URL multiprocess-0.70.19-py311-none-any.whl
Size 144.5 kB
Tags Python 3.11
SHA-256 checksum
How to use checksums
928851ae7973aea4ce0eaf330bbdafb2e01398a91518d5c8818802845564f45c
BLAKE2b-256 checksum
How to use checksums
86c2dec9722dc3474c164a0b6bcd9a7ed7da542c98af8cabce05374abab35edd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-py310-none-any.whl

Download URL multiprocess-0.70.19-py310-none-any.whl
Size 134.9 kB
Tags Python 3.10
SHA-256 checksum
How to use checksums
97404393419dcb2a8385910864eedf47a3cadf82c66345b44f036420eb0b5d87
BLAKE2b-256 checksum
How to use checksums
e3458004d1e6b9185c1a444d6b55ac5682acf9d98035e54386d967366035a03a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-py39-none-any.whl

Download URL multiprocess-0.70.19-py39-none-any.whl
Size 133.5 kB
Tags Python 3.9
SHA-256 checksum
How to use checksums
0d4b4397ed669d371c81dcd1ef33fd384a44d6c3de1bd0ca7ac06d837720d3c5
BLAKE2b-256 checksum
How to use checksums
7e8269e539c4c2027f1e1697e09aaa2449243085a0edf81ae2c6341e84d769b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl

Download URL multiprocess-0.70.19-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Size 144.7 kB
Tags Linux glibc 2.28+ x86-64 PyPy 3.11 PyPy 3.11 7.3
SHA-256 checksum
How to use checksums
1c3dce098845a0db43b32a0b76a228ca059a668071cfeaa0f40c36c0b1585d45
BLAKE2b-256 checksum
How to use checksums
afcbf421c2869d75750a4f32301cc20c4b63fab6376e9a75c8e5e655bdeb3d9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp311-pypy311_pp73-macosx_11_0_arm64.whl

Download URL multiprocess-0.70.19-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Size 144.7 kB
Tags PyPy 3.11 PyPy 3.11 7.3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5be9ec7f0c1c49a4f4a6fd20d5dda4aeabc2d39a50f4ad53720f1cd02b3a7c2e
BLAKE2b-256 checksum
How to use checksums
0fe1155f6abf5e6b5d9cef29b6d0167c180846157a4aca9b9bee1a217f67c959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp311-pypy311_pp73-macosx_10_15_x86_64.whl

Download URL multiprocess-0.70.19-pp311-pypy311_pp73-macosx_10_15_x86_64.whl
Size 144.7 kB
Tags PyPy 3.11 PyPy 3.11 7.3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
1bbf1b69af1cf64cd05f65337d9215b88079ec819cd0ea7bac4dab84e162efe7
BLAKE2b-256 checksum
How to use checksums
7eaa714635c727dbfc251139226fa4eaf1b07f00dc12d9cd2eb25f931adaf873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl

Download URL multiprocess-0.70.19-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
Size 135.1 kB
Tags Linux glibc 2.28+ x86-64 PyPy 3.10 PyPy 3.10 7.3
SHA-256 checksum
How to use checksums
c6b6d78d43a03b68014ca1f0b7937d965393a670c5de7c29026beb2258f2f896
BLAKE2b-256 checksum
How to use checksums
94b10b71d18b76bf423c2e8ee00b31db37d17297ab3b4db44e188692afdca628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp310-pypy310_pp73-macosx_11_0_arm64.whl

Download URL multiprocess-0.70.19-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Size 135.1 kB
Tags PyPy 3.10 PyPy 3.10 7.3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
79576c02d1207ec405b00cabf2c643c36070800cca433860e14539df7818b2aa
BLAKE2b-256 checksum
How to use checksums
9950faef2d8106534b0dc4a0b772668a1a99682696ebf17d3c0f13f2ed6a656a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp310-pypy310_pp73-macosx_10_15_x86_64.whl

Download URL multiprocess-0.70.19-pp310-pypy310_pp73-macosx_10_15_x86_64.whl
Size 135.1 kB
Tags PyPy 3.10 PyPy 3.10 7.3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
02e5c35d7d6cd2bdc89c1858867f7bde4012837411023a4696c148c1bdd7c80e
BLAKE2b-256 checksum
How to use checksums
8bb610832f96b499690854e574360be342a282f5f7dba58eff791299ff6c0637
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl

Download URL multiprocess-0.70.19-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl
Size 133.5 kB
Tags Linux glibc 2.28+ x86-64 PyPy 3.9 PyPy 3.9 7.3
SHA-256 checksum
How to use checksums
d6db91ca6391eebc139c352f34578cea382df6bfa03d3b4146ed12b18b01cc14
BLAKE2b-256 checksum
How to use checksums
4edba5fcaad04fb7b2e1c043df6f00d2a34ba88861ef5eeb11b82a3c80f813bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp39-pypy39_pp73-macosx_10_13_x86_64.whl

Download URL multiprocess-0.70.19-pp39-pypy39_pp73-macosx_10_13_x86_64.whl
Size 133.7 kB
Tags PyPy 3.9 PyPy 3.9 7.3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
e6c0674d34b8adac22533f6786576b3de4e396aaeda9e0c15378af9b8ada2702
BLAKE2b-256 checksum
How to use checksums
d0756e4fc33200ff67819b234150c594193109f4a4573106ee4e0f417b6f6e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release files / multiprocess-0.70.19-pp39-pypy39_pp73-macosx_10_13_arm64.whl

Download URL multiprocess-0.70.19-pp39-pypy39_pp73-macosx_10_13_arm64.whl
Size 133.5 kB
Tags PyPy 3.9 PyPy 3.9 7.3 macOS 10.13+ ARM64
SHA-256 checksum
How to use checksums
e5e7dc3e3e1732e88c07aaec17eeb9917f9ed1107d9e60d5ab985cdc14bac43a
BLAKE2b-256 checksum
How to use checksums
41abccd9652d32e79f8fc4235f64fbfb39c85583c96f4c2290ff7757cf213ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.70.19 This release

16 release files

0.70.9

3 release files

0.70.8

9 release files

0.70.7

9 release files

0.70.6

1 release file

0.70.5

1 release file

0.70.3

2 release files

0.70.2

0.70.1

2 release files

0.52.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page