Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 1999 08:33:38 -0600
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        "Daniel M. Eischen" <eischen@vigrid.com>
Cc:        Julian Elischer <julian@whistle.com>, freebsd-arch@freebsd.org
Subject:   Re: Threads
Message-ID:  <19991124083338.G1408@tar.com>
In-Reply-To: <383BF031.B52BC41F@vigrid.com>
References:  <Pine.BSF.4.10.9911232348550.11412-100000@current1.whistle.com> <383BF031.B52BC41F@vigrid.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 24, 1999 at 09:03:29AM -0500, Daniel M. Eischen wrote:

> > > The UTS knows what thread was running and marks it as blocked
> > > in the kernel and saves the unique KSE ID.
> > >
> > 
> > How does it know what was running?
> 
> How can it not know?  It was the last thread scheduled.
> 
> It _has_ to know which threads are running on which processes in
> order to effectively schedule them.  Our current threads library
> knows what thread is currently running - it is kept in _thread_run.
> 
> We need to be able to retrieve TSD from a register, or perhaps
> per-process data mapped at the same address but still accessible
> to other subprocesses.  Can we play games with %gs and/or LDTs?
> On the Alpha, can we just use an S register?  I dunno.  Another
> problem that really needs to be solved.

You may want to look at the latest linuxthreads code, which will
use some combination of LTD and %fs register manipulation (that
I don't profess to understand) to track the "current thread" and
its TLS.  I'm not sure if there is any work that will have to
be done to FreeBSD for newer linuxthreads code to work in linux
emulation mode, but in any case its something you might want to look at.

-- 
Richard Seaman, Jr.           email: dick@tar.com
5182 N. Maple Lane            phone: 262-367-5450
Chenequa WI 53058             fax:   262-367-5852




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991124083338.G1408>