[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [RFC][PATCH] _UC_TLSBASE for all ports
On Aug 10, 2012, at 10:32 AM, Emmanuel Dreyfus wrote:
> Matt Thomas <matt%3am-software.com@localhost> wrote:
>> I concur. A thread's stack is its identity and one can't swap stacks
>> without swapping its sense of self. (granted thread local storage
>> helps but that isn't universally available).
> This is not about the stack, this is about pthread_self() which can be
> changed by swapcontext(), making duplicate threads with the same
> pthread_self() and breaking mapping between userland and kernel threads.
Yes it is. A thread is tied to its stack. Its local thread
storage is stored adjacent to the stack. If you tell a thread to
start using another thread's stack (which a swapcontext of a saved
context will do), you are implicitly becoming that other thread.
if you start using using another thread's stack, you are assuming
the identity of that thread.
Main Index |
Thread Index |