--- libev/ev_linuxaio.c 2019/06/23 22:57:25 1.11 +++ libev/ev_linuxaio.c 2019/06/23 23:02:09 1.12 @@ -233,6 +233,7 @@ || ring->header_length != sizeof (struct aio_ring)) /* TODO: or use it to find io_event[0]? */ return 0; + /* make sure the events up to tail are visible */ ECB_MEMORY_FENCE_ACQUIRE; /* parse all available events, but only once, to avoid starvation */ @@ -245,8 +246,7 @@ } *(volatile unsigned *)&ring->head = tail; - - /* again, other implementations don't do this, but I think it's required for the kernel to see free slots */ + /* make sure kernel can see our new head value - probably not required */ ECB_MEMORY_FENCE_RELEASE; return 1;