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

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
主站蜘蛛池模板: 辽宁省| 青海省| 安康市| 大竹县| 斗六市| 扎囊县| 宁河县| 庆云县| 南部县| 高雄市| 呼和浩特市| 乐平市| 河曲县| 略阳县| 廉江市| 双鸭山市| 赣榆县| 沙湾县| 利川市| 红桥区| 辽源市| 布拖县| 开封县| 同心县| 安溪县| 巧家县| 铁岭县| 延津县| 门头沟区| 靖江市| 泰安市| 大兴区| 和龙市| 封丘县| 苍梧县| 北宁市| 明水县| 奉节县| 灵台县| 昌图县| 华池县|