In the MSDN example of the RegisterAsyncTask
method, they simply declare an AsyncTaskDelegate
which is invoked with Begin and End methods. When you asynchronously invoke a delegate it uses a thread from the thread pool so you are basically not getting any improvement in this case. The only speed improvement might be if you were executing multiple operations in parallel that would otherwise would be executed synchronously.
If you want to get a real performance boost you need to use IOCP (I/O Completion Ports). They are adapted to I/O intensive tasks such as network calls (database calls, web service calls, ...). Not suitable for CPU intensive tasks. So let's suppose that you want to perform an HTTP call using WebClient.DownloadStringAsync method. This method doesn't use a thread from the thread pool. It registers an IOCP with the kernel and fires the HTTP request. When it returns control to the caller no thread is being consumed and this during the whole HTTP request duration. Once the request finishes the IOCP is signaled and a thread is drawn from the thread pool to process the results.
Take a look at the asynchronous pages in ASP.NET article. IOCP are explained better there.