The platform I'm asking for is Linux. Local storage stream I'm talking about pthread_xxx or __thread in gcc.
I want to use ucontext, i.e. makecontext, swapcontext, etc. in my program. So my question is: how does it work with local thread storage? More specifically, if I switch to another fiber using swapcontext or setcontext, will the local stream store change or is the local stream store not part of the context?
Another question: if TLS is changed to setcontext / swapcontext , is there anything that sticks to the thread, no matter how I change the context? On the other hand, if TLS sticks to the context, is there anything that sticks to the stream and isn't changed using setcontext / swapcontext?
According to http://en.wikipedia.org/wiki/Fiber_ (computer_science) , the Windows platform has thread-based local storage and fiber storage.
source share