4
votes

Threads of the same process can run on different cores on a multicore processor . Suppose we have a multiprocessor system (not multicore) . Can two threads of the same process run on different processors at the same time ?

1

1 Answers

4
votes

The true answer depends on what operating system you are running on the hardware, and it depends on how that operating system is configured.

Out of the box, most operating systems will schedule different threads of the same process on different processors. Google for "processor affinity" for how you might change that.

The fact that different threads can be scheduled on different processors is the root of the whole memory visibility issue. If all threads of a single process were "pinned" to the same processor, then visibility would not be a problem.