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

Single-core execution

If this is executed in a single core, that core will then interleave between the three threads, each time filtering some of the words before switching to the next one. This interleaving process is called context switching.

Context switching adds overhead to the overall process, because it requires saving the state of the current thread and then loading the state of the next one. This overhead makes it likely that this multi-threaded implementation of isPalindrome() will take longer in a single-core machine when compared to the sequential implementation seen before. This happens because the sequential implementation will have one core do all the work but will avoid the context switch.

主站蜘蛛池模板: 丰宁| 张家口市| 阿瓦提县| 吴旗县| 呼玛县| 鹤岗市| 涟水县| 湖南省| 井陉县| 安福县| 郓城县| 葵青区| 五指山市| 禹城市| 九台市| 延庆县| 宁远县| 巴林右旗| 阳春市| 通渭县| 东宁县| 枞阳县| 安新县| 桦川县| 朝阳市| 上饶县| 名山县| 白银市| 科技| 黑山县| 海安县| 屏东县| 噶尔县| 十堰市| 绍兴市| 运城市| 鲁甸县| 通河县| 育儿| 呈贡县| 桐乡市|