multithreading on dual core machine?

前端 未结 5 2203
無奈伤痛
無奈伤痛 2020-12-05 21:30

I have a dual core processor and according to the explanation I\'m able to use only 2 threads but actually I\'m able to launch more than 2 threads at same time:

Here

5条回答
  •  没有蜡笔的小新
    2020-12-05 21:51

    There's a difference between optimal and possible results; there also is a difference between threads phisically and theoretically running at the same time. In a dual-core computer, there are 2 CPUs, that are able to execute two threads phisically at the same time. But the significance of any threading system/thread library is that you are able to create logically as meany threads as you want. These threads won't really run at the same time, they'll be switched over periodically instead to make the illusion as if they were running simoultaneously.

提交回复
热议问题