prototypes/wo-rt-c — single-file C reference of the writeonce runtime layer, zero deps beyond libc + kernel uapi: thread-per-core io_uring event loops (raw syscalls, no liburing), SO_REUSEPORT listeners, one mlock'd mmap arena sharded by address, WAL dual-write with group commit (HTTP ack only after the fsync CQE), boot-time snapshot + WAL replay recovery, and a bench harness with a Go net/http comparison server. Measured on 20 cores: 908k reads/s p99 154us and 643k fsync-acked commits/s p99 177us on 8 shards, vs Go net/http 495k/355k (no durability) on 20 cores. Crash-under-load testing found and fixed an ack-before-fsync race and an fd-reuse ABA hazard in commit-ack parking. docs/plan/exploration/c-runtime — the phased plan (00, exit evidence per phase), the one-address architecture trace (01), and the single-binary end-goal contract (02). justfile carries the demo and bench recipes; .gitignore covers binaries and data dirs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
19 lines
289 B
Makefile
19 lines
289 B
Makefile
CC ?= cc
|
|
CFLAGS ?= -O2 -Wall -Wextra -std=c11
|
|
LDFLAGS ?= -pthread
|
|
|
|
wo-rt: wo-rt.c
|
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
bench/bench: bench/bench.c
|
|
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
bench: bench/bench
|
|
|
|
run: wo-rt
|
|
./wo-rt
|
|
|
|
clean:
|
|
rm -f wo-rt bench/bench
|
|
|
|
.PHONY: bench run clean
|