How Go's Race Detector Works: Shadow Memory and Vector Clocks
The Go race detector is LLVM’s ThreadSanitizer shipped as a prebuilt blob: the compiler inserts read and write hooks, the runtime maps shadow memory for the heap and globals, and …
All posts published on this site.
Everything published here, newest first.
The Go race detector is LLVM’s ThreadSanitizer shipped as a prebuilt blob: the compiler inserts read and write hooks, the runtime maps shadow memory for the heap and globals, and …
reflect reads the runtime’s own abi.Type descriptors; a reflect.Value is a (typ, ptr, flag) triple whose flag word encodes kind, indirection, addressability and read-only state in …
Go’s select randomises the order it polls cases in, takes the first ready one, and only then falls back to parking on every channel at once.
Go’s Unicode tables are generated range tables with stride compression, a 256-entry Latin-1 byte table for the fast path, and an accept-ranges decoder for UTF-8; the runtime …
The compiler rewrites a range-over-func loop into a yield callback, tracks iterator misbehaviour with a state machine, and hands coroutine switching to iter.Pull.