Home > Software engineering > Network programming in multiple threads at the same time make multiple accept call
Network programming in multiple threads at the same time make multiple accept call
Time:09-23
Have a question want to discuss with everybody, in the iocp programming model, if there are multiple IO thread, one of the threads multiple recv operations that wait for a delivery should be the only time when data arrives at the thread in getqueuedcompletionstats returns, which is the corresponding delivery notification can only corresponding request thread informed, I understand it right
CodePudding user response:
Have A question want to discuss with everybody in the iocp programming model, if there are multiple IO thread, more than one thread A delivery recv operations there until data arrives only send corresponding delivery should be calling thread in getcopstats will return it (even if another thread also did the same action), namely the corresponding delivery notice only corresponding request notified thread, such as A thread to send delivery to accept each other's data in the first 10 k at this time another thread on the same socket to send to accept 15 k data after the sender recv call (assuming A thread that delivery is completed, thread B after delivery is completed, and are at the pend status), after it has completed the queue data such as the first to satisfy the request of A thread, even if only less than 10 k of data to arrive, then A getqueuedcompletionstats returns, then deliver the next recv, thread B recv request at this time have not received the data, such as A meeting with the data, at this time in the calling getqueuedcompletionstats A, B two threads only B can receive data and return, even if A is in the running state at this time, I understand no problem
CodePudding user response:
No one can answer, or no one can be a very good understand the mechanism of IOCP, we can discuss
CodePudding user response:
Iocp thread any delivery asynchronous recv, any thread can be getqueuedcompletionstats to obtain complete notification message,
CodePudding user response:
Iocp programming model in the repeated requests delivery recv do not exist? The second and later recv should receive less than things