I am learning asynchronous programming using C# and I usually use BeginInvoke, but I am not very sure about the other methods of creating asynchronous application.
I have asked a question about this,see below link for more details:
How to return T value from BeginInvoke?
In above link, Gravell said that there are four models of asynchronous development
There’s at least 4, then – a regular callback (non-APM, non-EAP) is also not uncommon
But Overflow said that there are three:
There are 3 models of asynchronous development in .NET
-
APM – (
BeginXXX/EndXXX) which you are using here, when the long running task completes, it calls back into your code in theEndXXXmethod -
EAP – Event based. In this model, when the long running task completes, an event is raised to inform your code.
-
TPL – New in .NET 4, this is the Task-based version. It looks most like synchronous programming to client code, using a fluent interface. Its calls back to your code using
ContinueWith.
Anyone can help me on this?
I have searched google.com a lot, but actually they are using BeginInvoke most. thanks for your help.
Thread.Start– brutaldelegate.BeginInvoke/EndInvoke– ‘old’ standardThreadPool.QueueUserWorkItem– smartTaskFactory.StartNew– the only way to do it correct (according toPatterns of parallel programmingbook | i recommend you to read it first for disambiguation)