How iocp works

Source: Internet
Author: User

I have been asked twice how iocp works (the operating system works, not the function), so I think it is necessary to write it down. After searching for the Internet for half a day, I wrote some functional implementation principles and did not mention the important points. In the last interview, the technical director told me that the book "Windows Advanced Programming Guide" has mentioned this, I came back and checked it out. I did have a detailed explanation on page 614, but I don't quite understand it. I 'd like to introduce the original article first:

Conclusion: The goal of port completion is to make the number of threads in the release thread (running thread) List and the number of concurrent threads specified when it is created (the last parameter of createiocompletionport, generally, the number of CPUs is the same. If one thread in the release thread list enters the waiting state and the release thread list becomes smaller, the other thread will be released after the completion of the port. Therefore, the number of threads to be created should be greater than the specified number of concurrent threads. Generally, the number of CPUs is * 2 + 2, which is said to be the optimal number of threads.

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.