Home > other >  Multiple threads at the same time make multiple accept call
Multiple threads at the same time make multiple accept call

Time:10-01

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 getcopstats returns, which is the corresponding delivery notice only corresponding request notified thread

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 getcmplestats return, followed by delivering 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 getcompletionstates 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:

Dear Daniel can answer this question
  • Related