Class LibUring.CqFastPath
java.lang.Object
express.mvp.myra.transport.iouring.LibUring.CqFastPath
- Enclosing class:
LibUring
Cached CQ accessors for hot-path polling.
LibUring.peekCqe(MemorySegment, MemorySegment) and LibUring.cqeSeen(MemorySegment, MemorySegment) are implemented in Java because liburing exposes them as static inline. The
naive implementation recreates multiple MemorySegment views on every call.
This helper caches the stable CQ pointers (khead/ktail) and the CQEs array view so that the poll loop only allocates the per-CQE slice, significantly reducing allocation pressure and improving tail latency.
-
Method Summary
Modifier and TypeMethodDescriptionintcqeFlags(int head) intcqeRes(int head) voidcqeSeen()Increment CQ head to mark the next CQE as consumed.voidcqeSeen(int head) Increment CQ head using a previously read head value.longcqeUserData(int head) intpeekCqe(MemorySegment cqePtr) intpeekHead()
-
Method Details
-
peekHead
public int peekHead()- Returns:
- CQ head if CQE available, -1 if none
-
cqeUserData
public long cqeUserData(int head) -
cqeRes
public int cqeRes(int head) -
cqeFlags
public int cqeFlags(int head) -
peekCqe
- Returns:
- 0 if CQE available, -EAGAIN if not
-
cqeSeen
public void cqeSeen()Increment CQ head to mark the next CQE as consumed. -
cqeSeen
public void cqeSeen(int head) Increment CQ head using a previously read head value.
-