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 ...
随机推荐
- GD2模块-图像处理
GD2模块-图像处理 1.图像处理模块的主要功能: a) 验证码 b) 加盖水印 c) 缩略图 d) 帖子图片签名 e) 在线LOGO制作 2确认PHP是否支持图像处理 检测PHPINFO文件中是否存 ...
- 通过powerdesiner导出sql,通过sql转mysql为oracle
1.导出sql文件 Database-->generate database-->确定 执行完就可以看到生成的语句了 2.将mysql的PDM转换为oracle File-->rev ...
- 实现简单的shell sed替换功能
通过脚本传参数可以实现替换 # -*-coding:utf-8-*- # Author:sunhao import sys f = open('yesterday','r',encoding='utf ...
- 通过调整浏览器UA设置欺骗限制上网
先上图片, 通过调整浏览器UA,欺骗识别,原来这个WIFI是只能手机端使用的,打开IE F12,进行如上图所示,进行修改,正常输入手机号,获取验证码,登陆后,即可上网了.虽然显示的是400,但实际 ...
- Vuex的学习笔记一
以下的解释,是在知乎看到的,感觉粗俗易懂. 组件之间的作用域独立,而组件之间经常又需要传递数据. A 为父组件,下面有子组件 B 和 C. A 的数据可以通过 props 传递给 B 和 C.A 可以 ...
- java学习笔记27(File类)
File类: 定义:文件和目录径的抽象表示形式, Java中将路径或者文件封装成File对象 1.File类的静态成员变量 package com.zs.Demo2; import java.io.F ...
- python day03--字符串
一.字符串 1.索引 s1 = "python最牛B" S1[0]第0个,从零开始算 s1[8]“B” 2.切片 语法: str[start: end]规则: 顾头不顾腚, 从st ...
- PaddlePaddle Perceptron Example
.caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px so ...
- bootstrap 4 pull-right无效
/********************************************************************** * bootstrap 4 pull-right无效 * ...
- IDEA 导出项目war包
部署 Maven 项目,使用 “mvn package” 命令出现错误,不能正确打包时的解决方法 一.最简单.最快的方式: 思路,本地能运行,直接把本地编译后能正确运行的项目文件打包,传到服务器部署即 ...