简体   繁体   中英

How to create multiple threads for the completion port?

Multiple threads can dequeue completion packets from a single completion port using the GetQueuedCompletionStatus() function. Is there a special function that creates these threads? Or I simply use for example CreateThread() or _beginthreadex() and create as much threads as I need?

There is nothing special about a thread that calls GetQueuedCompletionStatus() on a given IOCP. Any thread can do it. Therefore you can create your "I/O threads" using the usual thread creation functions. In general it's best to use _beginthreadex() unless you're writing code for platforms that do not support it OR you are not linking with the CRT.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM