Asynchrony (computer programming): Difference between revisions

Content deleted Content added
rewrite definition; note that Non-blocking algorithm is about a different notion of blocking
better source: book that directly defines asynchronous programming in the way just described
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 waiting ("''blocking")'' to wait for results.<ref>[http://msdn2.microsoft.com/en-us/library/7ch3stsw.aspx{{cite Microsoftbook documentation|title=Async describingin ''asynchronousC# message5.0 processing|first=Alex |last=Davies |publisher=O''.Reilly Accessed|year=2012 on|page=1 09-09-2007|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.
 
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.