Content deleted Content added
m Reverted edits by WhyDoesSheRefuseToHaveIntercourseWithMe (talk) to last version by 115.118.147.252 |
Separated summary and background paragraphs |
||
Line 1:
In ([[Thread (computer science)|multithreaded]]) [[object-oriented programming]], '''asynchronous method invocation''' ('''AMI'''), also known as '''asynchronous method calls''' or '''asynchronous pattern''' is a client-side support that doesn't block the calling thread while waiting for a reply. Instead, the calling thread is notified when the reply arrives. Polling for a reply is an undesired option.
== Background == '''AMI''' is a [[software design pattern|design pattern]] for [[asynchronous I/O|asynchronous]] invocation of potentially long-running [[method (computer science)|methods]] of an [[object (computer science)|object]].<ref name="Async.34.2#71139">{{cite web |url=http://www.zeroc.com/doc/Ice-3.2.1/manual/Async.34.2.html#71139 |title=Asynchronous Method Invocation |accessdate= 22 November 2008 |work=Distributed Programming with Ice |publisher=ZeroC, Inc.}}</ref> It is equivalent to the
The
In most programming languages a called method is executed synchronously, i.e. in the [[thread (computer science)|thread of execution]] from which it is invoked. If the method needs a long time to completion, e.g. because it is loading data over the internet, the calling thread is blocked until the method has finished. When this is not desired, it is possible to start a "worker thread" and invoke the method from there. In most programming environments this requires many lines of code, especially if care is taken to avoid the overhead that may be caused by creating many threads. AMI solves this problem in that it augments a potentially long-running ("synchronous") object method with an "asynchronous" variant that returns immediately, along with additional methods that make it easy to receive notification of completion, or to wait for completion at a later time.
|