[C#] Add shrike - epoll engine, RCA=true async handler#832
Open
MDA2AV wants to merge 1 commit into
Open
Conversation
Owner
Author
|
/benchmark -f shrike |
Contributor
|
👋 |
Contributor
Benchmark ResultsFramework:
Full log |
A C# epoll engine with an IVTS-backed, RCA=true async handler, fixed the Tokio way: the worker is a pure readiness notifier (epoll -> SignalReadable; it never touches the socket) and the handler does its own recv() on the thread pool (Connection.DoRecv). Only the handler touches the recv buffer, so there is no driver/handler race — the principled fix for the data race the worker-recv-then-handoff design had under RCA=true. Mirrors Tokio/mio (reactor flips readiness + wakes the task; the task reads on its worker thread). Serves baseline, pipelined, limited-conn; hand-rolled HTTP/1.1 (CL + chunked bodies, keep-alive, pipelining, fragmented reads); Connection: close sends a FIN. Validated 14/14 (every TCP-fragmentation case), 0/100 fragmented POST, 8000 keep-alive with zero drops.
Owner
Author
|
/benchmark -f shrike |
Contributor
|
👋 |
Owner
Author
|
/benchmark -f shrike-tokio |
Contributor
|
👋 |
Contributor
Benchmark ResultsFramework:
Full log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
shrike — a from-scratch C# epoll engine with an IVTS-backed,
RunContinuationsAsynchronously = truehandler loop.engine-tier, servingbaseline/pipelined/limited-conn. This is the RCA=true counterpart to the RCA=false io_uring engines (minima / minima-sync).Architecture (fully async-work-ready)
epoll_wait→ recv-drain →SignalReadable. It runs no handler code.awaitarbitrary work and still respond.FlushAsyncdoes a thread-safesend()directly — so an off-worker handler sends with no handoff back to the worker (the epoll advantage:send()is a syscall any thread can make).SO_REUSEPORT, pooled connections, native slab buffers, hand-rolled HTTP/1.1.Handler (
Program.cs)Hand-rolled over the recv buffer: request line,
Content-Lengthand chunked bodies, keep-alive, pipelining (batched per drain), fragmented-read reassembly.Connection: closesends a FIN viashutdown(SHUT_WR).GET/POST /baseline11?a=&b=text/plain—a + b(+ POST body)GET /pipelinetext/plain—okOne vendored fix
EPOLLIN is made one-shot (re-armed by the handler in
ReadAsync). Because the handler runs off-worker (RCA=true), the original edge-triggered EPOLLIN let the worker recv-drain the connection buffer while the handler was still parsing it — a data race exposed by fragmented requests. One-shot serializes recv against the handler.Verification
validate.sh: 14/14, including every TCP-fragmentation case (split request line / headers / body bytes) and chunked.