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 ...
随机推荐
- 201621123001 《Java程序设计》第11周学习总结
1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结多线程相关内容. 一个进程可以同时运行多个不同线程,不同的线程执行不同的任务 Java线程是通过java.lang包中定义的Thre ...
- Codeforces Round #506 (Div. 3) D. Concatenated Multiples
D. Concatenated Multiples You are given an array aa, consisting of nn positive integers. Let's call ...
- 《RECURRENT BATCH NORMALIZATION》
原文链接 https://arxiv.org/pdf/1603.09025.pdf Covariate 协变量:在实验的设计中,协变量是一个独立变量(解释变量),不为实验者所操纵,但仍影响实验结果. ...
- JavaWeb:指令标识
指令标识 一.介绍 指令标识主要用于设定完整的JSP页面范围内有效的相关的信息,它是被服务器解释并执行,但是它不会在页面中显示. 二.语法格式 <%@ 指令名 属性1=“属性值1” 属性2=“属 ...
- Delphi 10.3终于来了
http://altd.embarcadero.com/download/radstudio/10.3/delphicbuilder10_3_0_94364.iso 安装工具: http://ww ...
- HDU 6092 17多校5 Rikka with Subset(dp+思维)
Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he ...
- jvm内存增长问题排查简例
jvm内存增长问题排查 排查个jvm 内存占用持续增加的问题,纪录一下,引以为戒. 运维发现应用jvm内存占用在发布后回落,然后持续增高,,dump后分析一下: 占内存的大部分是这种名字相似的bean ...
- day01计算机组成与操作系统
1.什么是编程语言编程语言是程序员与计算机之间的沟通介质 2.什么是编程编程的过程就是程序员通过某种语言将命令给到计算机并让计算机表达出来 修改后:编程就是程序员按照某种语法规则将自己想让计算机做的事 ...
- webservice------UDDI SOAP WSDL 之间的关系
[ 真的是服了一些博客.....啰里啰唆的将一堆== 根本不知道讲的是什么 ... 在描述一个定义之前 (不如先通俗的讲它是干什么的)] SOAP(Simple Object Access P ...
- Codeforces Round #519
题目链接:传送门 A. Elections (思维+暴力) 思路: 从最小的k开始枚举就好了- -. #include <bits/stdc++.h> using namespace ...