O'Reilly logo

.NET Programming: A Practical Guide Using C# by Pradeep Tapadiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

The .NET Framework supports multithreaded programming in two ways:

  1. By letting you explicitly create and use threads.

  2. By letting you make asynchronous calls.

Using the class Thread, you can create a thread, abort a thread, or wait for a thread to complete. You can also adjust the properties of a thread, such as the priority and the COM apartment model.

Class Thread and all other thread-related classes are defined under the namespace System.Threading.

You can use asynchronous delegates to make asynchronous calls. In this case, .NET uses threads from a thread pool to serve your request. You can use BeginInvoke to execute a method asynchronously and optionally use EndInvoke to retrieve output parameters. The asynchronous delegates work seamlessly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required