Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 1999 15:57:52 -0400
From:      "Daniel M. Eischen" <deischen@gdeb.com>
To:        julian@whistle.com
Cc:        marcel@scc.nl, jake@checker.org, freebsd-arch@freebsd.org
Subject:   Native threads (was Re: rfork patch, please comment)
Message-ID:  <3818AAC0.D5587B9E@gdeb.com>

next in thread | raw e-mail | index | archive | help

Julian Elischer wrote:
> I know I've been a fan of using rfork for native threads,
> (and all the support that we need for a linuxthreads is already there
> (see the linuxthread PORT to freebsd)). But I was speakin gwith terry the
> other day and he managed to convince me that there is an even better way
> that we could do this.
> 
> It's really quite elegant.

Let's hear more.  Especially if we can get efficient access to
thread-specific data.

I've been looking at various papers on threading, and was the most
impressed with the "Scheduler Activations: Effective Kernel Support
for the User Level Management of Parallelism".

The basic plan I had laid out was to:

  1. Develop support for {get,set,make,swap}context.

  2. Add a system call or two to allow the kernel to upcall
     to a ucontext which would notify the threads library when
     a process blocks/unblocks in the kernel.  This would also
     change the threads library and eliminate all the polling.

  3. Add support for multiple [lightweight] processes to get
     M by N threading.  The basic problem here is how to get fast
     access to thread-specific data (including a pointer to the
     current thread).

I have working i386 support for 1.  Marcel said he might be able
to help with the Alpha-bits.  #2 doesn't seem that difficult, but
will involve changes to the wait queues that might be questioned.
My biggest concern with #3 was TSD.  Inter [lightweight] process
locking doesn't seem _that_ difficult given that the threads library
does all the scheduling and is notified when a process blocks.

Dan Eischen
eischen@vigrid.com




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?3818AAC0.D5587B9E>