3 ms·
One thing the segment registers are still used for are thread local storage (on Linux). So you read data from FS (different per thread) segment but same address
by Erwin 6y ago
One thing the segment registers are still used for are thread local storage (on Linux). So you read data from FS (different per thread) segment but same address, if you've prefixed your variable with __thread.
(Having said that, I remember optimizing thread local storage away by explicit pointers some time ago in my code, because it was calling some function to get the address constantly, so maybe there are some subtleties there)
- rkeene2 6y agoFWIW, there was a good LWN article recently on the work to expose FS to userspace control safely