Skip to content

ordering of mutliple writes to same socket #1102

Closed Answered by axboe
laf0rge asked this question in Q&A
Discussion options

You must be logged in to vote

In general, you should not have multiple send/sendmsg on the same socket. Most of the time this will work fine, as this is what will happen:

  1. sendA is prepared
  2. sendB is prepared
  3. io_uring_submit()
  4. sendA is issued, socket has space, sendA is complete
  5. sendB is issued, socket has space, sendB is complete

Everything is fine and dandy in this case. However, you could also potentially see:

  1. sendA is prepared
  2. sendB is prepared
  3. io_uring_submit()
  4. sendA is issued, socket has no space, poll is armed for send A
    5a) sendB is issued, since sendA socket space has freed up, hence sendB can complete
    5b) sendA retry is triggered via poll callback.
  5. send A is retried

5a and 5b can happen at the same time, h…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by laf0rge
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants