How to program to have all processors on your machine used?

I am running a single-threaded python program that performs massive data processing on my windows box. My machine has 8 processors. When I monitor the CPU usage in performance tab under Windows Task Manager, it shows that I am using only a very small fraction of the processing power available to me. Only one processor is being used to the fullest and all the rest are almost idle. What should I do to ensure that all my processors are used? Is multithreading a solution?

Answers


multithreading cannot make use of extra processors or cores.

You should spawn new processes instead of new threads.

This tool is by far the simplest among all that I have come across: parallel python

Overview:

PP is a python module which provides mechanism for parallel execution of python code on SMP (systems with multiple processors or cores) and clusters (computers connected via network).

It is light, easy to install and integrate with other python software.

PP is an open source and cross-platform module written in pure python


Need Your Help

Function Pointer parameter from any class

c++ function-pointers

Hey is it somehow possible to take a function pointer as parameter from any other class?

NTFS Files Permissions in Java 6

java permissions file-permissions jdk1.6

It's possible to retrieve all permissions of a file in NTFS FileSystem with Java 6? I know in Java 7 it's very simple. Anyone know some framework to do that?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.