I need to execute 3 parallel tasks and after completion of each task they should call the same function which prints out the results.
I don\'t understand in .net why
This is a long forgotten thread, but something that wasn't mentioned here at all was that there are two type of work, Compute and I/O bound.
In the case of Compute bound work, this is executed in a separate thread (if you use BackgroundWorker
or Begin/End
pattern, this comes from the Thread pool; or, a custom thread if you decided to create your own thread).
I/O bound on the other hand is executed in I/O ports (hardware support), and do not require a thread; File access and Network sockets are two examples of I/O bound tasks.
If you have a long running process (e.g. a form application, IIS, Web Service, Windows Service) you will likely be better off using the Async methods. Threads require system resources and overhead. I always try to avoid creating threads. If I can't, I try to rely on ThreadPool to handle/manage them.
You might get more applicable info if you can tell us what your application is.
BeginInvoke uses a delegate behind the scenes where as the Async methods usually don't.