Synchronization between threads or processes

Source: Internet
Author: User
The Linux general technology-Linux programming and kernel information that comes to mind for synchronization between threads or processes. The following is a detailed description. Although two threads are created in this function and pWriteW-> ResumeThread () is called twice, the first pWriteW-> ResumeThread () is not called () immediately execute the first thread, because the thread itself is also a thread, under the same priority, the operating system can schedule other threads only after the function of the Creation thread is executed, just like the mian function of the process created in linux, although multiple processes with the same priority are created

Void CMultiThread9Dlg: OnWritew () {CWinThread * pWriteW = AfxBeginThread (WriteW, & m_ctrlW, THREAD_PRIORITY_NORMAL, 0, create_suincluded); pWriteW-> ResumeThread (); CWinThread * pWriteD = AfxBeginThread (WriteD, & m_ctrlD, THREAD_PRIORITY_NORMAL, 0, create_suincluded); pWriteD-> ResumeThread ();}

Compile and run the program, and click "Write 'W'" to understand the role of the event object.
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.