# Threaded programming



## blah44 (Dec 13, 2013)

_[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?


----------



## nslay (Dec 14, 2013)

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%).


----------



## xibo (Dec 20, 2013)

Or you can see what CPUs schedule which threads by pressing H (large h) in top(1).


----------

