Callback Design
There are two types of callbacks: blocking callbacks (also known as synchronous callbacks or just callbacks) and deferred callbacks (also known as asynchronous callbacks). These two design choices differ in how they control data flow at runtime. While blocking callbacks are invoked before a function returns (in the example above: main), deferred callbacks may be invoked after a function returns. The above is an example of a blocking callback. Deferred callbacks are often used in the context of I/O operations or event handling. While deferred callbacks imply the existence of multiple threads, blocking callbacks are often (but not always) relying on a single thread. Therefore blocking callbacks are no common cause for synchronization.
Read more about this topic: Callback (computer Programming)
Famous quotes containing the word design:
“You can make as good a design out of an American turkey as a Japanese out of his native stork.”
—For the State of Illinois, U.S. public relief program (1935-1943)