并发与并行
【摘要】并行指在同一时刻,有多条指令在多个处理器上同时执行;并发指在同一时刻只能有一条指令执行,但多个进程(线程)指令被快速轮换执行,使得宏观上具有多个进程(线程)同时执行的效果。
一、 并发的定义
维基百科 Concurrent computing is a form of computing in which several computations are executed during overlapping time periods—concurrently—instead of sequentially (one completing before the next starts). This is a property of a system—this may be an individual program, a computer, or a network—and there is a separate execution point or "thread of control" for each computation ("process"). A concurrent system is one where a computation can advance without waiting for all other computations to complete.
百度文库 并发(Concurrency),在操作系统中,是指一个时间段中有几个程序都处于已启动运行到运行完毕之间,且这几个程序都是在同一个处理机上运行,但任一个时刻点上只有一个程序在处理机上运行。
二、并行的定义
维基百科 Parallel computing is a type of computation in which many calculations or the execution of processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. There are several different forms of parallel computing: bit-level, instruction-level, data, and task parallelism. Parallelism has long been employed in high-performance computing, but it's gaining broader interest due to the physical constraints preventing frequency scaling. As power consumption (and consequently heat generation) by computers has become a concern in recent years, parallel computing has become the dominant paradigm in computer architecture, mainly in the form of multi-core processors.
并行计算是一种同时进行许多计算或过程执行的计算。大问题往往可以分为小问题,然后可以同时解决。并行计算有几种不同的形式:位级、指令级、数据和任务并行。并行性一直被用于高性能计算中,但由于物理约束阻止了频率伸缩,它得到了更广泛的关注。近年来,随着计算机的功耗(以及由此产生的热量)成为人们关注的焦点,并行计算已成为计算机体系结构中的主导范式,主要以多核处理器的形式出现。
百度文库 并行(Parallelism),在操作系统中是指,一组程序按独立异步的速度执行,不等于时间上的重叠(同一个时刻发生)。要区别并发。并发是指:在同一个时间段内,两个或多个程序执行,有时间上的重叠(宏观上是同时,微观上仍是顺序执行)。
三、 并发与并行
并行指在同一时刻,有多条指令在多个处理器上同时执行;并发指在同一时刻只能有一条指令执行,但多个进程(线程)指令被快速轮换执行,使得宏观上具有多个进程(线程)同时执行的效果
文章分享:
并发与并行的区别
网友评论