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

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.

主站蜘蛛池模板: 壤塘县| 喀喇| 普定县| 岳阳市| 桂林市| 邛崃市| 云龙县| 高台县| 读书| 泽库县| 白水县| 靖边县| 安义县| 新昌县| 介休市| 岢岚县| 民勤县| 资源县| 棋牌| 塔城市| 武胜县| 本溪市| 仁寿县| 永德县| 彭泽县| 湛江市| 望都县| 公主岭市| 甘孜| 中江县| 金塔县| 山阳县| 藁城市| 唐海县| 陵川县| 宜昌市| 潞西市| 甘德县| 南溪县| 政和县| 遂川县|