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.7

  • setuptools, >=42

  • dill, >=0.3.6

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. See multiprocess.examples for a set of example scripts. You can also run the test suite with python -m multiprocess.tests. 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multiprocess-0.70.14.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

multiprocess-0.70.14-py310-none-any.whl (134.3 kB view details)

Uploaded Python 3.10

multiprocess-0.70.14-py39-none-any.whl (132.9 kB view details)

Uploaded Python 3.9

multiprocess-0.70.14-py38-none-any.whl (132.0 kB view details)

Uploaded Python 3.8

multiprocess-0.70.14-py37-none-any.whl (115.7 kB view details)

Uploaded Python 3.7

multiprocess-0.70.14-pp39-pypy39_pp73-manylinux_2_24_x86_64.whl (133.0 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ x86-64

multiprocess-0.70.14-pp39-pypy39_pp73-manylinux_2_24_i686.whl (133.0 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ i686

multiprocess-0.70.14-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (133.0 kB view details)

Uploaded PyPymacOS 10.9+ x86-64

multiprocess-0.70.14-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl (132.2 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ x86-64

multiprocess-0.70.14-pp38-pypy38_pp73-manylinux_2_24_i686.whl (132.2 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ i686

multiprocess-0.70.14-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (132.2 kB view details)

Uploaded PyPymacOS 10.9+ x86-64

multiprocess-0.70.14-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl (115.8 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ x86-64

multiprocess-0.70.14-pp37-pypy37_pp73-manylinux_2_24_i686.whl (115.8 kB view details)

Uploaded PyPymanylinux: glibc 2.24+ i686

multiprocess-0.70.14-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (115.8 kB view details)

Uploaded PyPymacOS 10.9+ x86-64

File details

Details for the file multiprocess-0.70.14.tar.gz.

File metadata

  • Download URL: multiprocess-0.70.14.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.8

File hashes

Hashes for multiprocess-0.70.14.tar.gz
Algorithm Hash digest
SHA256 3eddafc12f2260d27ae03fe6069b12570ab4764ab59a75e81624fac453fbf46a
MD5 210315f0978d08fd8975ec879a0240ed
BLAKE2b-256 e3ab9aafc121c6a3d2470ccdf28f99897e88d324c948893b30e46cb359f595e3

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-py310-none-any.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-py310-none-any.whl
Algorithm Hash digest
SHA256 7dc1f2f6a1d34894c8a9a013fbc807971e336e7cc3f3ff233e61b9dc679b3b5c
MD5 333b28febf1db862c31bb5f3c0be11bf
BLAKE2b-256 b80cc26b346b41bb1f81ac921fa10074a9595c22e5f99cc89c0410fc4efd5df3

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-py39-none-any.whl.

File metadata

  • Download URL: multiprocess-0.70.14-py39-none-any.whl
  • Upload date:
  • Size: 132.9 kB
  • Tags: Python 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.8

File hashes

Hashes for multiprocess-0.70.14-py39-none-any.whl
Algorithm Hash digest
SHA256 63cee628b74a2c0631ef15da5534c8aedbc10c38910b9c8b18dcd327528d1ec7
MD5 5f68fd0b8b709372698d54608a54e7b6
BLAKE2b-256 6af4fbeb03ef7abdda54db4a6a75c971b88ab73d724ff09e3275cc1e99f1c946

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-py38-none-any.whl.

File metadata

  • Download URL: multiprocess-0.70.14-py38-none-any.whl
  • Upload date:
  • Size: 132.0 kB
  • Tags: Python 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.8

File hashes

Hashes for multiprocess-0.70.14-py38-none-any.whl
Algorithm Hash digest
SHA256 6725bc79666bbd29a73ca148a0fb5f4ea22eed4a8f22fce58296492a02d18a7b
MD5 a131f293e08212ed83639b46a76f70de
BLAKE2b-256 13958b875a678c6f9db81809dd5d6032e9f8628426e37f6aa6b7d404ba582de1

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-py37-none-any.whl.

File metadata

  • Download URL: multiprocess-0.70.14-py37-none-any.whl
  • Upload date:
  • Size: 115.7 kB
  • Tags: Python 3.7
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.8

File hashes

Hashes for multiprocess-0.70.14-py37-none-any.whl
Algorithm Hash digest
SHA256 93a8208ca0926d05cdbb5b9250a604c401bed677579e96c14da3090beb798193
MD5 7305948002b3a6db9c05483e152d91fc
BLAKE2b-256 f100c1b90843cb80e6a1911f480e92a92b1258efcdd32ed4fe87449703416fc4

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp39-pypy39_pp73-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp39-pypy39_pp73-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 cea5bdedd10aace3c660fedeac8b087136b4366d4ee49a30f1ebf7409bce00ae
MD5 178293a4e7da4002e071c455f9a61c20
BLAKE2b-256 c8c1f645c98666bd416594b57e126391a19c537ffe9e95a4098f2ef0be5c5c12

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp39-pypy39_pp73-manylinux_2_24_i686.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp39-pypy39_pp73-manylinux_2_24_i686.whl
Algorithm Hash digest
SHA256 6a7b03a5b98e911a7785b9116805bd782815c5e2bd6c91c6a320f26fd3e7b7ad
MD5 3a545343d7264db3551cfd7d66170f8b
BLAKE2b-256 8f7158e5b6f1c3f63701a228ba94ffe9af9609ee2616d1a180a635290eeead21

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp39-pypy39_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0d5da0fc84aacb0e4bd69c41b31edbf71b39fe2fb32a54eaedcaea241050855c
MD5 190558bfa8ca4c5346bb7b7901503f69
BLAKE2b-256 5b2802430c489398529a6dbe79c2af31a6e3872761541b58415b3896672e9999

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 e628503187b5d494bf29ffc52d3e1e57bb770ce7ce05d67c4bbdb3a0c7d3b05f
MD5 1c6718c3aa3723c6c3a3e5116817c908
BLAKE2b-256 e08894282ab787f8d4adb86bd904017e0edff22115be601f53604755396b8043

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp38-pypy38_pp73-manylinux_2_24_i686.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp38-pypy38_pp73-manylinux_2_24_i686.whl
Algorithm Hash digest
SHA256 44936b2978d3f2648727b3eaeab6d7fa0bedf072dc5207bf35a96d5ee7c004cf
MD5 be6d8f9a1b3a1e8429a5ad93ab41d4bb
BLAKE2b-256 e69e5e3a2a924d11fdad006d27a6a009cb68ae23dda7f94e738a005bd84046b7

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp38-pypy38_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 40a5e3685462079e5fdee7c6789e3ef270595e1755199f0d50685e72523e1d2a
MD5 560f9bc5481c1cb12cb6b966ac081a2c
BLAKE2b-256 eb97d96514a4702697d52074b65c7e53b7557654f492f5233e2b84d4b374a932

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 89fed99553a04ec4f9067031f83a886d7fdec5952005551a896a4b6a59575bb9
MD5 bdfa1ae5fcf607249f10ae2e70771a8b
BLAKE2b-256 3b51bbb9f1c814767f61ceb29bed72b8804153a84d56d7d1c503873a4b34d130

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp37-pypy37_pp73-manylinux_2_24_i686.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp37-pypy37_pp73-manylinux_2_24_i686.whl
Algorithm Hash digest
SHA256 bfbbfa36f400b81d1978c940616bc77776424e5e34cb0c94974b178d727cfcd5
MD5 fab8b09c600b9f49554bd58edc8e2270
BLAKE2b-256 22bda0e41a1cef8ca5276696e894fcf31276713d8e82e14bfcd1682834647300

See more details on using hashes here.

File details

Details for the file multiprocess-0.70.14-pp37-pypy37_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for multiprocess-0.70.14-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 560a27540daef4ce8b24ed3cc2496a3c670df66c96d02461a4da67473685adf3
MD5 18c8f01f1719d7300c97a2ab695796f0
BLAKE2b-256 6c5f582156e3c2b060f886a2746a78c7ee1bfeb326d98dce29e61be7a05bef92

See more details on using hashes here.

Supported by

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