Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676940 - dev-python/multiprocess - better multiprocessing and multithreading in python
Summary: dev-python/multiprocess - better multiprocessing and multithreading in python
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Default Assignee for New Packages
URL: https://github.com/uqfoundation/multi...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-30 18:03 UTC by Martin Mokrejš
Modified: 2019-02-01 09:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2019-01-30 18:03:45 UTC
Hi,
  the multiprocess module https://github.com/uqfoundation/multiprocess is an improved version of the standard multiprocessing module. It should require >=dev-python/dill-0.2.8.2 as of now.


#!/usr/bin/env python
#
# works in core python
#
import multiprocessing
print multiprocessing.__version__

def f(x): return x*x

pool = multiprocessing.Pool(processes=4)
print pool.map(f, range(10))
pool.close()
pool.join()



#!/usr/bin/env python
#
# requires multiprocess with dill module installed
import multiprocess
pool = multiprocess.Pool(processes=4)
print (pool.map(lambda x: (lambda y:y**2)(x) + x, xrange(10)))