博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
并发性与并行性 并发性与并行性
阅读量:4044 次
发布时间:2019-05-24

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

Concurrency versus parallelism
Concurrency and parallelism are very similar concepts. Different authors give different definitions to these concepts. The most accepted definition talks about concurrency when you have more than one task in a single processor with a single core and the operating system's task scheduler quickly switches from one task to another, so it seems that all the tasks run simultaneously. The same definition talks about parallelism when you have more than one task that run simultaneously at the same time, in a different computer, processor, or core inside a processor. 
Another definition talks about concurrency when you have more than one task (different tasks) running simultaneously on your system. One more definition discusses parallelism when you have different instances of the same task running simultaneously over different parts of a dataset.
The last definition that we include talks about parallelism when you have more than one task that runs simultaneously in your system and talks about concurrency to explain the different techniques and mechanisms programmers have to synchronize with the tasks and their access to shared resources.

As you can see, both concepts are very similar and this similarity has increased with the development of multicore processors.

并发和并行是非常相似的概念。不同的作者对这些概念给出了不同的定义。当您在单个处理器中使用单个核心拥有多个任务并且操作系统的任务计划程序可以快速从一个任务切换到另一个任务时,最接受的定义就涉及并发性,因此似乎所有任务都同时运行。当同一时间同时运行多个任务时,在处理器中的不同的计算机,处理器或核心中,同样的定义将讨论并行性。

当您的系统上同时运行多个任务(不同的任务)时,另一个定义会谈到并发。当同一任务的不同实例同时运行在数据集的不同部分时,还有一个定义讨论了并行性。
我们包括的最后一个定义是在您的系统中同时运行多个任务时讨论并行性,并讨论并发性,以解释程序员必须与任务及其对共享资源的访问权限进行同步的不同技术和机制。
可以看出,这两个概念非常相似,随着多核处理器的发展,这种相似性也在增加。

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

你可能感兴趣的文章
01Java基础语法-19. 循环跳转控制语句
查看>>
Django框架全面讲解 -- Form
查看>>
socket,accept函数解析
查看>>
今日互联网关注(写在清明节后):每天都有值得关注的大变化
查看>>
”舍得“大法:把自己的优点当缺点倒出去
查看>>
[今日关注]鼓吹“互联网泡沫,到底为了什么”
查看>>
[互联网学习]如何提高网站的GooglePR值
查看>>
[关注大学生]求职不可不知——怎样的大学生不受欢迎
查看>>
[关注大学生]读“贫困大学生的自白”
查看>>
[互联网关注]李开复教大学生回答如何学好编程
查看>>
[关注大学生]李开复给中国计算机系大学生的7点建议
查看>>
[关注大学生]大学毕业生择业:是当"鸡头"还是"凤尾"?
查看>>
[茶余饭后]10大毕业生必听得歌曲
查看>>
gdb调试命令的三种调试方式和简单命令介绍
查看>>
C++程序员的几种境界
查看>>
VC++ MFC SQL ADO数据库访问技术使用的基本步骤及方法
查看>>
VUE-Vue.js之$refs,父组件访问、修改子组件中 的数据
查看>>
Vue-子组件改变父级组件的信息
查看>>
Python自动化之pytest常用插件
查看>>
Python自动化之pytest框架使用详解
查看>>