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

CodePudding user response:

reference 5 floor smwhotjay reply:
iocp thread any delivery asynchronous recv, any thread can be obtain complete notification message, getqueuedcompletionstats

Thank you for your answer, also seen in other posts you answer before this problem, this problem by looking up information is, indeed, you say this kind of situation is not I understand, but now I have one more question, with one or more of the IO operation system can guarantee them according to the order of operations to complete, but why when the acceptance notice does not necessarily to notified in accordance with the operating order

CodePudding user response:

The
reference 4 floor zhao4zhong1 reply:
baidu search "HP - SOCKET"

After your answer can see can watch, suggest you don't answer the question in other people's posts

CodePudding user response:

refer to 6th floor youyingbo response:
iocp programming model in the repeated requests delivery recv do not exist? The second and later recv should receive something less than

Of course not, unless there is no data behind

CodePudding user response:

references 9 f cppabc response:
Quote: refer to the sixth floor youyingbo response:

Iocp programming model in the repeated requests delivery recv do not exist? The second and later recv should receive something less than

Of course not, unless there is no data behind the


I said there is no delivery recv many times request refers to the continuous delivery recv many times
Is delivering a recv request first, data arrival, enter the callback function, the callback function in charge to all of the data, according to individual needs, or send a data to each other, and then deliver recv request, ready to receive the next set of data, or other operations,
If the other party and you have no interaction, a steady stream of data, or just need to deliver a recv request, in the recv request a callback function to collect all the data, the socket will not send a packet of data to send you more "data has arrived,"

CodePudding user response:

Several times if the other party to send data, the receiver is delivering a recv request first, in the callback function to receive the first package of data, and then deliver the next recv request, receive the second package data

CodePudding user response:

11 references youyingbo response:
several times if the other party to send data, the receiver is delivering a recv request first, in the callback function to receive the first package of data, and then deliver the next recv request, receive the second package data

You say this kind of situation can also process the data correctly, and I said you are not the same, the same socket on multiple requests

CodePudding user response:

refer to the eighth floor cppabc response:
Quote: refer to 4th floor zhao4zhong1 response:

Baidu search "HP - SOCKET"

After your answer can see can watch, suggest you don't answer the question in other people's posts

https://bbs.csdn.net/topics/392372284

CodePudding user response:

"Windows core programming"

CodePudding user response:

On the 14th floor zhao4zhong1
reference response:
"Windows core programming"

Don't let me read a book, if you have seen can answer my question directly

CodePudding user response:

No one can answer
  • Related