This article will be based on the article, based on further explain the relevant knowledge thread. This article related to knowledge have thread priority , foreground and background thread , the thread parameters , Lock , Monitor and thread exception handling . This one has a little more difficult than to improve on, but please do not worry, I still use a lot of code to demonstrate knowledge of each point, and for the difficulties which I will explain in detail. Here we begin to learn The second basic knowledge.
First, the thread priority
.NET gives us define a variety of thread priorities, which are located ThreadPriority in, namely: Lowest , BelowNormal , Normal , AboveNormal and Highest . Their priority and described in the following table:
priority | Explanation |
---|---|
Lowest | Lowest priority |
BelowNormal | Located behind the Normal priority |
Normal | The default priority, all threads have priority |
AboveNormal | After located Highest Priority |
Highest | Highest priority |
Under normal circumstances, if a higher priority threads are running, do not give low priority thread allocated any CPU time, so that you can ensure that important / main thread has a higher priority. In most