Assigning Multiple Cores to a Python Program

Harpal picture Harpal · Dec 23, 2010 · Viewed 17.3k times · Source

I notice when I run my heavily CPU dependant python programs, it only uses a single core. Is it possible to assign multiple cores to the program when I run it?

Answer

moinudin picture moinudin · Dec 23, 2010

You have to program explicitly for multiple cores. See the Symmetric Multiprocessing options on this page for the many parallel processing solutions in Python. Parallel Python is a good choice if you can't be bothered to compare the options, look at the examples here.

Some problems can't take advantage of multiple cores though. Think about how you could possibly run up the stairs faster with the help of three friends. Not going to happen!