Threaded programming

[Moved to the programming forum -- mod.]

Simple question, if I have a two-core Pentium and spawn a few threads from a single process, will they get scheduled across both cores?

How about if I have two single-core processors?
 
Yes, they will be scheduled across both cores in both cases.

You can test this by spawning two threads and watching top(1) (you will see CPU usage of 200%).
 
Back
Top