Does it make sense to spawn more than one thread per processor?

前端 未结 9 1205
面向向阳花
面向向阳花 2020-12-10 16:15

From a logical point of view an application may need dozens or hundreds of threads, some of which will we sleeping most of the time, but a very few will be always running co

9条回答
  •  囚心锁ツ
    2020-12-10 16:50

    This may make sense if

    1. your program design benefits, in that you have parallel tasks that are best implemented in threads, or

    2. some of your threads are I/O-bound, so they do not utilize the processors /cores on their own.

提交回复
热议问题