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

Get Microsoft® .NET Compact Framework (Core Reference) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.