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

Concurrency versus parallelism in CPU-bound algorithms

CPU-bound algorithms will benefit from parallelism but probably not from single-core concurrency. For example, the previous algorithm that takes a list of words and filters the palindromes could be modified so that a thread is created per each 1,000 words received. So, if isPalindrome() receives 3,000 words, the execution could be represented like this:

isPalindrome creating a thread per each 1,000 words
主站蜘蛛池模板: 昆明市| 怀来县| 锦屏县| 天等县| 通榆县| 和龙市| 潢川县| 巴青县| 凭祥市| 杂多县| 宁远县| 绩溪县| 浏阳市| 姚安县| 阿图什市| 左贡县| 定西市| 色达县| 宁强县| 驻马店市| 新晃| 合阳县| 根河市| 宁波市| 张家港市| 康马县| 东明县| 陆良县| 南宫市| 枝江市| 石泉县| 板桥市| 余江县| 苍梧县| 凤庆县| 凉山| 庆云县| 和田市| 玉屏| 武强县| 迭部县|