|
|||||
|
The Windows operating system can run multiple tasks or applications at the same time. The term Thread in .Net and Windows means a series of commands executed in sequence. For example, an application is considered single threaded when the application is started, does some processing and then terminates. An application would be considered multi-threaded when the application branches off, creating two streams of execution. Multi-threaded applications are useful in writing a server-type application, like a web server. On high volume web sites, as soon as a client requests a page, the web server creates a thread to service this request and then as the newly created thread processes the request, the main thread waits for the next connection request.
Creating a Thread Tell ThreadStart the entry point of the thread. In our example, we are creating two threads with two separate and distinct entry points. Once the thread class is instantiated, threads do not start until the Start() method is called. Stopping a Thread Go To Page: 1 2
The copyright of the article How to Create, Stop and Suspend Threads in C# in C# Programming is owned by . Permission to republish How to Create, Stop and Suspend Threads in C# in print or online must be granted by the author in writing.
|
|||||
|
|
|||||
|
|
|||||