3 ms·
Thread-local variables are implemented using a reserved register. Essentially thread-locals in C++ are the hidden context.
by _0w8t 4y ago
Thread-local variables are implemented using a reserved register. Essentially thread-locals in C++ are the hidden context.
- astrange 4y agoThat doesn't "lose" a register because the program already wasn't using it.
- LegionMammal978 4y agoTo be fair, they're implemented with one of the segment registers, at least on x86-64. So there isn't much else that programs could have used it for, since it takes a syscall just to set the value.