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

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.

主站蜘蛛池模板: 瑞安市| 忻州市| 成安县| 金川县| 共和县| 天长市| 马龙县| 西平县| 精河县| 瑞昌市| 寻甸| 布拖县| 温州市| 西乌| 肥城市| 甘肃省| 田林县| 舟山市| 无棣县| 玉门市| 峨山| 固安县| 东莞市| 彭阳县| 岗巴县| 昌平区| 花莲市| 嘉义市| 河西区| 开远市| 新津县| 射洪县| 资源县| 湖南省| 广南县| 齐河县| 开远市| 海门市| 奉节县| 灵台县| 龙胜|