I need someone to explain the following names;
- Asynchronous Delegates.
- Asynchronous methods.
- Asynchronous events.
I’m currently going over this for my 70-536 exam and I am covering all my bases so far.
The threading chapter and online resources have been good to me on my second read through.
Still though, the names used above mean absolutely nothing to me? I would really appreciate the meaning behind the word ‘Asynchronous’ and its relevance to Delegates, methods and events.
Feel free to go into as much detail as you like.
‘Asynchronous’ describes a type of execution flow.
Synchronous instructions execute linearly and prevent subsequent instructions from executing until complete (that is, they block). So given the following synchronous code:
DoAnotherThingdoesn’t execute untilDoOneThingis finished.Asynchronous instructions differ in that you don’t know (or sometimes even care) when they start or finish executing. In a case like this:
The first statement initiates the asynchronous operation, then does another thing immediately before the first operation is completed (or perhaps even started).
There are many different mechanisms for providing asynchronous execution: the most common ones (at least in the .NET world) are probably the
ThreadPool(for in-process asynchronous execution) and Microsoft Message Queue (for inter-process asynchronous execution). For a .NET-specific introduction, you might start with this MSDN topic, “Including Asynchronous Calls”.So asynchronous delegates, methods, and events all run (and complete) at indeterminate times and do not block the main thread of execution.