O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

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

Creating a Multithreaded Application

Any application you write already has a single thread. For example, in a Microsoft Visual C# application, there is a thread that runs the Main function, known as the primary thread. Any extra threads within that application are created by the application code as it runs and are known as secondary, or worker, threads. After your program creates and starts an extra thread, the operating system schedules it to run in parallel to the primary thread on the basis that only running threads will be scheduled for execution. Your application now appears to be performing two tasks at once.

You can create new threads explicitly by constructing new Thread objects or implicitly by using the Timer class or the ThreadPool

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