From owner-freebsd-arch Wed Nov 24 12:23:25 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id E5584150E9 for ; Wed, 24 Nov 1999 12:23:23 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id VAA09343 for ; Wed, 24 Nov 1999 21:23:08 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id VAA35638 for freebsd-arch@freebsd.org; Wed, 24 Nov 1999 21:23:07 +0100 (MET) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id DAAA414F4E for ; Wed, 24 Nov 1999 12:22:26 -0800 (PST) (envelope-from julian@whistle.com) Received: from current1.whiste.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id MAA48914; Wed, 24 Nov 1999 12:20:52 -0800 (PST) Date: Wed, 24 Nov 1999 12:20:52 -0800 (PST) From: Julian Elischer To: "Louis A. Mamakos" Cc: Daniel Eischen , Matthew Dillon , "Daniel C. Sobral" , freebsd-arch@freebsd.org Subject: Re: Threads In-Reply-To: <199911241957.OAA42011@whizzo.transsys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 24 Nov 1999, Louis A. Mamakos wrote: > > Wow, so this has turned way too complicated. I confess to having the same > basic questions as Matt; why all this complexity? I think the answer is > that there's a belief that having the kernel context switch between threads > is too expensive, thus the desire to multiplex "user" threads on to fewer > "kernel scheduled" threads. This is not just a 'belief'. This is known. The work done by SUN on this and the work done by other people in the field (e.g. CMA MACH project and the much referenced Scheduler activations paper) ALL show the same thing. The optimal threading system is a hybrid. > > To answer your question: I think the question you're asking doesn't make > any sense. I think Matt was proposing that there's simply a kernel > thread context that exists for each and every "user" thread that's active > in the application. Today, there's only one of these that's intimately > associated with the process context (contains MMU/VM cntext, file descriptors, > etc.) There can be thousandds of user threads, do we want a kernel thread for each one? > > > I think we want to avoid having the kernel know too much about each > > thread. It is something that is more easily handled in the threads > > library. > > Why? If someone has done measurements comparing the different approaches, > and show that there's too much "overhead", then that's great. But it > appears that there's a considerable price to be paid in additional complexity > by sticking a user-mode thread library with it. For measurements I direct you to the "Scheduler Activations" paper by Anderson et al. (referenced early in this thread) If it's done right (and has kernel support) the user land scheduler is relatively simple. > > I ask simply because in my prior experiences with multi-threaded operating > systems, there was no such thread multiplexing happening in user space. > Certain my NeXTSTEP based system, running on a crummy 25MHz 68040 didn't > die from the "overhead". Based on Mach2.5 I know that Mach 2.5 had two threading models available. but th ekernel model was not very suitable for very large numbers of threads.. it was great for the kind of app that makes 4 threads. Not great for the kind that makes 1000. > > And previously to that, on old UNIVAC 1100 series mainframes, there > certainly wasn't any such thing going on. Their idea of "lightweight" > threads (they called them "activities") had a reduced register set to > save on context switching overhead. And they had compiler support from memory. > > Wouldn't you have minimal support for non-multiplexed threads first? For > many applications with just a handful of threads, the "overhead" issue > probably isn't even noticable. We already have that.. try the Linuxthreads port. Works great for that class of app that works great on it. :-) > > And I just hate to think of the crocks that debuggers will need to have to > be aware of this thread multiplexing going on in user space. That is a worry certainly. But it was solved for Solaris > > louie > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message