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

前端 未结 9 1228
面向向阳花
面向向阳花 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:53

    According to Herb Sutter (one of the leading experts on concurrency), one of the Pillars of Concurrency is Responsiveness and Isolation Via Asynchronous Agents. The summary is:

    Stay responsive by running tasks independently and tasks asynchronously, communicating via messages.

    Great article (and the series as a whole!). I am still waiting for the book.

提交回复
热议问题