Michael Schnell wrote:
> 
> >No, it's not done like that.  Linux does not provide thread-specific
> >virtual memory mappings, except for special cases like the
> >vsyscall/vdso page.
> >  
> So - even with "full" Linux, the __thread variables have different 
> addresses per thread ?

Yes.

> This does not make sense to me

Because you haven't thought it through.  You are allowed to take the
address of a __thread variable in one thread, and access that specific
instance from another thread, so long as the first thread has not
terminated.

> as there is an MMU that would make accessing these variable on a
> single address possible

Also doing it through the MMU would be slower.  Count the TLB flushes.

There are some circumstances in which the MMU version would be faster.
Dynamically loaded libraries containing __thread variables do some
indirection to access them, and virtual memory might reduce or
eliminate the indirection.  But other things would be slower.

-- Jamie
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to