mattharrison/coreit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
coreit ------- Helper function to throw code on cores that can be run in parallel. If you have code like >>> for i in xrange(start, stop): ... slow_function(i) You can speed it up on a 4-core machine by running it like so: >>> functions = [slow_function for i in xrange(start, stop)] >>> args = [(i,) for i in xrange(start, stop)] >>> coreit(functions, args, 4) Note that >>> p = multiprocessing.Pool(4) >>> p.map(slow_function, xrange(start, stop)) is built in and does the equivalent. As such, this code is somewhat obsolete, but has a distinction: if you have *different* functions that you want to run concurrently, coreit will do it. Pool.map won't. Requirements ------------- * multiprocessing (python 2.6 or http://code.google.com/p/python-multiprocessing/) Todo ---- * ? Licensed under PSF license Copyright (c) 2010 Matt Harrison (matthewharrison@gmail.com)
About
Python helper to throw code on cores that can run in parallel
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published