It's Friday and it's going to be a good day.
Threads are foreground threads by default, and all foreground threads exit after the program is launched.
The default threads in a process are called the main thread or the UI thread.
As long as there is a foreground thread running, the application process is running, and if multiple foreground threads are running, and the Main method is finished, the application process is still active until all foreground threads are completed.
Thread re-entry: multiple threads accessing the same resource can cause an out of sync situation, using the keyword lock (this).
Call the Start method of thread, you can create a thread, after calling the Start method, the new thread is still not in the running state, but the unstarted state, only the operating system thread Scheduler chooses the
Thread, the thread will change to the running state, with the ThreadState property, to get the current state of the thread
Using Thread.Sleep () to put a thread in WaitSleepJoin, after a defined time, the thread waits to be awakened again
Stops a thread. Call the Abort method.
[2014-9-12] Multithreading