News for hackers. Stuff that matters.
Re:Efficient IO in Linux with io_uring [pdf] by cash22 on Sunday October 16, 2022 @02:54AM (#33221644)
On page 5:

> To find the index of an event, the application must mask the current tail index with the size mask of the ring. This commonly looks something like the below:

  unsigned head;
  head = cqring→head;
  read_barrier();
  if (head != cqring→tail) {
    struct io_uring_cqe *cqe;
    unsigned index;
    index = head & (cqring→mask);
    cqe = &cqring→cqes[index];
    /* process completed cqe here */
    ...
    /* we've now consumed this entry */
    head++;
  }
  cqring→head = head;
  write_barrier();
Am I misunderstanding, or is "current tail index" supposed to be "current head index?"

There are no comments on this comment yet.