1:N threading
Daniel Eischen
eischen at pcnet1.pcnet.com
Thu Apr 3 16:26:23 PST 2003
On Thu, 3 Apr 2003, Peter Wemm wrote:
> Daniel Eischen wrote:
>
> > The patches are available:
> >
> > http://people.freebsd.org/~deischen/libpthread.diffs
> >
> > FYI, since this is a new mailing list, the above changes
> > are meant to give libpthread M:N capability.
> >
> > I don't need testers; I have enough bugs that I know about
> > to fix.
>
> + __asm__("movl %%gs, %0" : "=r" (id));
> + id >>= 3;
> + if (id - NLDT < 0)
>
> There is a problem here, NLDT is kernel private and changes depending on
> things like whether SMP is enabled or what the maximum number of cpus
> is.
>
> You're trying to find if its a local or global selector, right?
> What you really want is bit 2 which tells you which it is.
>
> #define ISLDT(s) ((s)&SEL_LDT) /* is it local or global */
> #define SEL_LDT 4 /* local descriptor table */
OK, but if NLDT is kernel private, how do can I know
what LDTs I can use as local? (*)
(*) The only thing I know about LDTs came from an Intel
486 architecture manual.
--
Dan Eischen
More information about the freebsd-threads
mailing list