Re: Thread-private mappings and graphics (was Re: Per-Processor Data

H. Peter Anvin (hpa@transmeta.com)
14 Dec 1999 21:57:30 -0800


Followup to: <Pine.LNX.3.96.991214021400.376B-100000@wakko.deltatee.com>
By author: Jason Gunthorpe <jgg@ualberta.ca>
In newsgroup: linux.dev.kernel
>
> I'm not sure if someone mentioned this before but..
>
> It seems to me that in the OS/2 environment this problem was solved by
> sacrificing one of the i386 segment registers to a thread-specific value.
> Each thread stored a thread id of sorts that could be used to quickly
> perform a table lookup and find thread local stuff [it may even have been
> that it was a valid segment, don't remember]. There even existed extended
> compilers (CSet and HighC) that could generate this inlined code
> automatically though some weird pragma.
>
> Obviosly rather Intel specific, but a different sort of solution :>
>

Not really. The use of a segment register is just a way to compensate
for the lack of registers on the i386; on any other CPU you would
typically use a GPR for the glocal data base pointer. The function is the
same: you add the glocal data base pointer to each address; this is an
attribute on the pointer data type.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/