Multi-thread knowledge Summary

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.