spuyet
spuyet

Reputation: 81

Do multiple processes may run in parallel on a multi thread single core CPU?

I know that there is some shared resources like L2 cache, etc between threads so is that two threads on the same core can run instructions from different processes in parallel ?

Upvotes: 0

Views: 73

Answers (1)

Alexei Kaigorodov
Alexei Kaigorodov

Reputation: 13535

This is the question of terminology. Hardware and software people use the same words differently. I understand your question as follows:

I know that there is some shared resources like L2 cache, etc between hardware threads so is that two hardware threads on the same core can run instructions from different processes in parallel ?

Then I translate hardware terms to software language:

I know that there is some shared resources like L2 cache, etc between processors so is that two processors on the same core can run instructions from different software threads in parallel ?

and immediately answer: yes, of course.

UPDT "Does two software threads (from the same process) can be run on two different CPUs in parallel?"

yes, of course. Moreover, if each CPU consists of many cores, each core can serve separate software thread and so is indistinguishable from a processor. For example, my Intel i7 microchip has 4 cores/8 threads and standard Java function Runtime::availableProcessors() returns 8, that is, 8 separate software threads could be run in parallel. If my machine had 2 such microchips, it would return 16 and 16 separate threads could be run in parallel.

Upvotes: 1

Related Questions