Asynchrony (computer programming): Difference between revisions

Content deleted Content added
better source: book that directly defines asynchronous programming in the way just described
parallelism
Line 1:
{{merge from|Asynchronous method dispatch|date=January 2016}}
<!-- DO NOT ADD DISAMBIGUATION TAGS TO THIS PAGE (per [[WP:INCOMPDAB]] and [[WP:DABCONCEPT]]) -->
'''Asynchrony''', in [[computer programming]], refers to the occurrence of events independently of the main [[control flow|program flow]] and ways to deal with such events. These may be "outside" events such as the arrival of [[Unix signal|signals]], or actions instigated by a program that take place [[concurrent computing|concurrently]] with program execution, without the program ''blocking'' to wait for results.<ref name="davies">{{cite book |title=Async in C# 5.0 |first=Alex |last=Davies |publisher=O'Reilly |year=2012 |pagepages=11–2 |url=https://books.google.com/books?id=xT45qhFrVnUC}}</ref> [[Asynchronous I/O|Asynchronous input/output]] is an example of the latter cause of asynchrony, and lets programs issue commands to storage or network devices that service these requests while the [[processor]] continues executing the program. Doing so provides a degree of [[parallel computing|parallelism]].{{r|davies}}
 
A common way for dealing with asynchrony in a [[application programming interface|programming interface]] is to provide [[subroutine]]s (methods, functions) that return to their caller an object, sometimes called a [[futures and promises|future or promise]], that represents the ongoing events. Such an object will then typically come with a synchronizing operation that blocks until the operation is completed.