Single Threaded Builds
Zig has a compile option --single-threaded
which has the following effects:
- All Thread Local Variables are treated as Global Variables.
- The overhead of Async Functions becomes equivalent to function call overhead.
- The
@import("builtin").single_threaded
becomestrue
and therefore various userland APIs which read this variable become more efficient. For examplestd.Mutex
becomes an empty data structure and all of its functions become no-ops.