The event loop is single-threaded, saturating at roughly 60k req/s on one core. For multi-core scaling, the standard approach is fork + SO_REUSEPORT: each child process runs its own event loop bound to the same port, and the kernel distributes incoming connections.
Requires:
TcpListener.set-reuseport in the socket library
System.fork exposed in Carp
- A
serve-with-workers variant or a worker-count parameter on serve
Blocked on a clean concurrency story in Carp. The thread-based alternative (pthreads or green threads) needs the StaticFn proposal or a fix for the closure-capture-mutation issue.
The event loop is single-threaded, saturating at roughly 60k req/s on one core. For multi-core scaling, the standard approach is fork + SO_REUSEPORT: each child process runs its own event loop bound to the same port, and the kernel distributes incoming connections.
Requires:
TcpListener.set-reuseportin the socket librarySystem.forkexposed in Carpserve-with-workersvariant or a worker-count parameter onserveBlocked on a clean concurrency story in Carp. The thread-based alternative (pthreads or green threads) needs the StaticFn proposal or a fix for the closure-capture-mutation issue.