What is the difference between concurrency, parallelism and asynchronous methods?
Ref: http://stackoverflow.com/questions/4844637/what-is-the-difference-between-concurrency-parallelism-and-asynchronous-methods
Concurrent and parallel are effectively the same principle as you correctly surmise, both are related to tasks being executes simultaneously although I would say that parallel tasks should be truly multitasking, executed "at the same time" whereas concurrent could mean that the tasks are sharing the execution thread while still appearing to be executing in parallel.
Concurrent and parallel几乎相同,都是跟task同时执行有关。parallel 的task是真正的同时执行,而concurrent表示共享执行单元但是看起来是同时执行
Asynchronous methods aren't directly related to the previous two concepts, asynchrony is used to present the impression of concurrent or parallel tasking but effectively an asynchronous method call is normally used for a process that needs to do work away from the current application and we don't want to wait and block our application awaiting the response.
Asynchronous 方法跟前两者没直接关系,异步用于表达concurrent or parallel task;但 asynchronous method call通常用于不直接写 current application,避免wait and block our application
For example, getting data from a database could take time but we don't want to block our UI waiting for the data. The asynch call takes a call-back reference and returns execution back to your code as soon as the request has been placed with the remote system. Your UI can continue to respond to the user while the remote system does whatever processing is required, once it returns the data to your call-back method then that method can update the UI (or hand off that update) as appropriate.
比如,从数据库获取数据会占用时间,但我们不想block ui。asynch call会传入call-back 之后直接返回。UI可以继续执行,而远程系统完成之后callback会执行从而update你的ui
From the User perspective it appears like multitasking but it may not be.
这个看起来像multitasking 但可能不是
EDIT
It's probably worth adding that in many implementations an asynchronous method call will cause a thread to be spun up but it's not essential, it really depends on the operation being executed and how the response can be notified back to the system.
在很多asynchronous 的实现里会创建线程,但这不是必须的。这依赖于操作如何执行,以及response如何notified
What is the difference between concurrency, parallelism and asynchronous methods?的更多相关文章
- Concurrency != Parallelism
前段时间在公司给大家分享GO语言的一些特性,然后讲到了并发概念,大家表示很迷茫,然后分享过程中我拿来了Rob Pike大神的Slides <Concurrency is not Parallel ...
- Concurrency in csharp (Asynchronous, Parallel, and Multithreaded Programming)
http://stephencleary.com/projects/ /// <summary> /// /// </summary> public partial class ...
- Concurrency vs. Parallelism
http://getakka.net/docs/concepts/terminology Terminology and Concepts In this chapter we attempt to ...
- Java Concurrency - Fork/Join Framework
Normally, when you implement a simple, concurrent Java application, you implement some Runnable obje ...
- Morgan Stanley telephone interview
Today is Monday, April 28. I get a telephone call from Morgan Stanley in Shanghai. My examiner is a ...
- (概念)多个CPU和多核CPU以及超线程(Hyper-Threading)
引言 在这篇文章中我会主要介绍CPU相关的一些重要概念和技术.如果你想更好地了解操作系统,那就从本文开始吧. 中央处理器(Central processing unit) 在我们了解其它概念之前,我们 ...
- 转:详解G1垃圾收集器
G1垃圾收集器入门 说明 concurrent: 并发, 多个线程协同做同一件事情(有状态) parallel: 并行, 多个线程各做各的事情(互相间无共享状态) 参考: What’s the dif ...
- MySQL-->基础-->002-->MySQL存储引擎
mysql的存储引擎主要有:MyISAM和InnoDB MyISAM和InnoDB的主要区别:InnoDB支持事务和参照完整性(即为主键约束,数据库的主键和外键类型一定要一致) 存储引擎是针对表而言而 ...
- Async/Await FAQ
From time to time, I receive questions from developers which highlight either a need for more inform ...
随机推荐
- git中误删提交(commit)后,怎么恢复
“xml文件存储数据”提交被我误操作,即使用reset --hard删除了,然后又进行了三次提交,发现删除的提交有用,需要找回来, 于是找了好久,找到好方法: 1.进入工程下的.git文件下,git ...
- 开窗函数 函数() OVER()
-- 初始化 CREATE TABLE T_Person (FName VARCHAR2(20), FCity VARCHAR2(20), FAge INT, FSalary INT); INSERT ...
- kbmMW授权管理解析(The kbmMW Authorization manager explained)
从kbmMW v.4.40开始,引入了一个新的非常灵活的授权管理器. 它的目的是为开发人员提供为用户定义资源权限的功能,这是一个可选功能,将现有的授权事件驱动方案内置到kbmMW中,使授权开发任务更容 ...
- 本周java 学习进度报告
本周java 学习进度报告 本周对我的感触很深,因为这是我初学java 语言的第一周,我认识到java 和c语言是有很多的不同之处和相同之处.我这几天几乎是在研究java 基础入门知识,而并没有太多的 ...
- Python 网络通信协议 tcp udp区别
网络通信的整个流程 在这一节就给大家讲解,有些同学对网络是既熟悉又陌生,熟悉是因为我们都知道,我们安装一个路由器,拉一个网线,或者用无限路由器,连上网线或者连上wifi就能够上网购物.看片片.吃鸡了, ...
- 使用json通过telegraf生成metrics(摘自telegraf github文档)
JSON: The JSON data format flattens JSON into metric fields. NOTE: Only numerical values are convert ...
- js - 如何使子元素阻止继承父元素事件
想要阻止点击 #content 区域时触发a事件,需要在 #content 区域内加入阻止事件冒泡的代码,具体代码如下: <div id="box" onclick=&quo ...
- 【转】Skynet之消息队列 - 消息的存储与分发
Skynet之消息队列 - 消息的存储与分发 http://www.outsky.org/code/skynet-message-queue.html Sep 8, 2014 按我的理解,消息队列是S ...
- 2017-2018-2 20165228 实验四《Android程序设计》实验报告
一.实验报告封面 课程:Java程序设计 班级:1652班 姓名:苏祚堃 学号:20165228 指导教师:娄嘉鹏 实验日期:2018年5月14日 实验时间:13:45 - 3:25 实验序号:实验四 ...
- WEBBASE篇: 第二篇, HTML知识2
HTML知识2 <!doctype html> <html lang="en"> <head> <meta charset="U ...