3

I'm running a python script that does some operations over a large graph, so I would like to take advantage of the 4 cores of my PC. Watching the task manager I can see that all CPUs are running but the total CPU usage is up to 50%. As I set this PC exclusively to run this script I would like to use its CPUs as much as possible. Is there a python module or anything that can be set in my OS (windows 7) in order to allow me to do that?

1

2 Answers 2

7

C Python has a rather generous lock that precludes most threaded operations from truly happening in parallel. You might want to look at the Multiprocessing module.

Otherwise, you could use a Python implementation that allows for concurrent threading:

Sign up to request clarification or add additional context in comments.

Comments

1

Have a read through this module:

http://docs.python.org/library/threading.html

for very good work and a more simple example:

http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/

Hope these help!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.