I,Process/thread
Process: An independent unit for the system to allocate and schedule resources. (Save resources)
Thread: The basic unit for CPU scheduling and scheduling. (Execution)
Button#click (button3_Click (Thread thread = thread. IsBackground =; sum = (I =; I <; I ++ sum + = MessageBox. Show (sum. ToString ());}View Code
II,Foreground thread/background thread
Main thread(UI thread ).
Iii. Thread re-entry and Solution
Lock (this)Processing. this indicates the current object. Only one thread can be executed before another thread can be executed.
TextBox. checkforillegalcrossthreadcils =; button#click (thread = thread. IsBackground = () (I =; I <; I ++ num = num ++ textBox1.Text =}View Code
4. Thread Scheduling
5. common attributes of threads
6. Lottery Program
Label. checkforillegalcrossthreadcall= button1_Click (button1.Text = thead. IsBackground = button1.Text = button1.Text = Random r = (Thread. Sleep (Control c Label lab = c (lab! = Lab. Text = r. Next (,}View Code
7. The thread calls a method with Parameters
Button#click (ParameterizedThreadStart s = Thread t = t. IsBackground = t. Start (TestThreadParsms (obj )}View Code
Certificate ------------------------------------------------------------------------------------------------------------------------------------------
Soft seek online education is the most suitable for online software training for college students and office workers. It mainly teaches asp.net dynamic website production and remote real-time teaching in the yy education room. Each course is recorded as a high-definition video and shared after class, the instructor provides 8 hours of full-time online tutoring during the day. Add QQ group: 138800420 for free trial.