博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Concurrency and Application Design
阅读量:7244 次
发布时间:2019-06-29

本文共 2908 字,大约阅读时间需要 9 分钟。

Concurrency and Application Design

In the early days of computing, the maximum amount of work per unit of time that a computer could perform was determined by the clock speed of the CPU. But as technology advanced and processor designs became more compact, heat and other physical constraints started to limit the maximum clock speeds of processors. And so, chip manufacturers looked for other ways to increase the total performance of their chips. The solution they settled on was increasing the number of processor cores on each chip. By increasing the number of cores, a single chip could execute more instructions per second without increasing the CPU speed or changing the chip size or thermal characteristics. The only problem was how to take advantage of the extra cores.

In order to take advantage of multiple cores, a computer needs software that can do multiple things simultaneously. For a modern, multitasking operating system like OS X or iOS, there can be a hundred or more programs running at any given time, so scheduling each program on a different core should be possible. However, most of these programs are either system daemons or background applications that consume very little real processing time. Instead, what is really needed is a way for individual applications to make use of the extra cores more effectively.

The traditional way for an application to use multiple cores is to create multiple threads. However, as the number of cores increases, there are problems with threaded solutions. The biggest problem is that threaded code does not scale very well to arbitrary numbers of cores. You cannot create as many threads as there are cores and expect a program to run well. What you would need to know is the number of cores that can be used efficiently, which is a challenging thing for an application to compute on its own. Even if you manage to get the numbers correct, there is still the challenge of programming for so many threads, of making them run efficiently, and of keeping them from interfering with one another.

So, to summarize the problem, there needs to be a way for applications to take advantage of a variable number of computer cores. The amount of work performed by a single application also needs to be able to scale dynamically to accommodate changing system conditions. And the solution has to be simple enough so as to not increase the amount of work needed to take advantage of those cores. The good news is that Apple’s operating systems provide the solution to all of these problems, and this chapter takes a look at the technologies that comprise this solution and the design tweaks you can make to your code to take advantage of them. 

 

https://developer.apple.com/library/content/documentation/General/Conceptual/ConcurrencyProgrammingGuide/ConcurrencyandApplicationDesign/ConcurrencyandApplicationDesign.html#//apple_ref/doc/uid/TP40008091-CH100-SW2

 

转载地址:http://mqybm.baihongyu.com/

你可能感兴趣的文章
iOS开发秘笈:如何通过WebView监控提升WebAPP性能
查看>>
笨办法学C 练习4:Valgrind 介绍
查看>>
超详细cordova环境配置(windows)及实例
查看>>
关于浮动float
查看>>
进入2016 -- 回顾我走过的编程之路
查看>>
SegmentFault D-Day 北京场「iOS」 活动回顾
查看>>
★★★★盲转接业务的sipp脚本实现
查看>>
Leetcode-Two Sum
查看>>
汉语言处理包 HanLP 1.7.3 发布,常规维护版本
查看>>
滑屏组件----slide
查看>>
Android 凉了?聊聊Android的出路,架构必备技术
查看>>
如何用纯 CSS 创作一个苹果系统的相册图标
查看>>
货拉拉完成 3 亿美元 D 轮融资,2018 年全年业务量增长将近 200% ...
查看>>
观点 | 阿里资深技术专家:优秀的数据库存储引擎应具备哪些能力? ...
查看>>
Golang AES加密
查看>>
Android之greenDao使用
查看>>
Ceph Storage Cluster(CEPH存储集群) Configuration配置
查看>>
mysql面试题分组并合并列
查看>>
如何用纯 CSS 创作一台拍立得照相机
查看>>
洛谷 P3369 BZOJ 3224 【模板】普通平衡树(Treap/SBT)
查看>>