Open MarkReedZ opened 5 months ago
I went with breaking out of the loop after N iterations.
I really liked your idea of using a tail assigned at the start of the loop though, I think that's a nice general thing to do and it would solve your issue as well.
A server using for_each_cqe with SQPOLL set will overflow the cqe ring given enough connections / time such that we keep getting new CQEs added onto the end before we complete the loop.
As peek/wait is significantly slower than this loop does anyone have a better method of cq polling in this case? Queue'ing the events and doing a second loop is a 5% slowdown.
This is the for_each macro. Perhaps saving the tail prior to the loop would be okay?