官术网_书友最值得收藏!

  • Mastering C# Concurrency
  • Eugene Agafonov Andrew Koryavchenko
  • 160字
  • 2021-07-09 21:26:08

Chapter 3. Understanding Parallelism Granularity

One of the most essential tasks when writing parallel code is to divide your program into subsets that will run in parallel and communicate between each other. Sometimes the task naturally divides into separate pieces, but usually it is up to you to choose which parts to make parallel. Should we use a small number of large tasks, many small tasks, or maybe large and small tasks at the same time?

Theoretically speaking, it does not matter. In case of an ideal computational device, it would have no overhead for creating a worker thread and distributing work between any numbers of threads. However, on a real CPU, this performance overhead is significant and it is very important to take this into account. The right way to split your program into parallel parts is the key to writing effective and fast programs. In this chapter, we are going to review this problem in detail.

主站蜘蛛池模板: 琼结县| 安新县| 云和县| 无极县| 锦州市| 汝南县| 东源县| 巴彦淖尔市| 奎屯市| 柘荣县| 兴文县| 水城县| 乳源| 武夷山市| 常州市| 依安县| 布尔津县| 汉沽区| 宝清县| 安多县| 广昌县| 海宁市| 内黄县| 广宗县| 乡城县| 舒兰市| 晴隆县| 绥棱县| 云阳县| 临西县| 德安县| 梁河县| 苏尼特右旗| 康乐县| 大洼县| 龙海市| 大渡口区| 柳江县| 綦江县| 镇巴县| 鄂伦春自治旗|