From owner-freebsd-arch Thu Nov 16 20:34:36 2000 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id A2D5F37B4CF for ; Thu, 16 Nov 2000 20:34:32 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eAH4YTl27184; Thu, 16 Nov 2000 20:34:29 -0800 (PST) Date: Thu, 16 Nov 2000 20:34:28 -0800 From: Alfred Perlstein To: Garrett Rooney Cc: frank xu , arch@freebsd.org Subject: Re: potentially simpler approach than scheduler activations. Message-ID: <20001116203428.M18037@fw.wintelcom.net> References: <20001116184200.L18037@fw.wintelcom.net> <20001116232358.A25846@electricjellyfish.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001116232358.A25846@electricjellyfish.net>; from rooneg@electricjellyfish.net on Thu, Nov 16, 2000 at 11:23:58PM -0500 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Garrett Rooney [001116 20:23] wrote: > On Thu, Nov 16, 2000 at 06:42:01PM -0800, Alfred Perlstein wrote: > > * frank xu [001116 18:25] wrote: > > > I have readed an article about KSE from jasone, it's cool, can complete > > > resolve much headache, but you method has same problems as LinuxThread, > > > jasone already > > > talked about it, in new FreeBSD 5.0, why can't we have a new way to go? > > > > Actually KSE is closer to Linuxthreads than my suggestion from my > > point of view. Can you elaborate a bit? > > well, i don't know if you've come up with a way around this, but in the > KSE paper (avail. from http://www.freebsd.org/~jasone/kse) the problems > with using rfork() based threads for spreading threads across processors > runs into the following issues: > > 1) each thread is a separate process, and such has a unique pid. POSIX > requires each thread to appear to have the same pid, so substantial > modifications to the kernel data structures would be required. > > 2) thread priority semantics specified by POSIX cannot be implimented > because each thread is a a process. thread contention at the > application level is therefor not possible, all threads are scheduled as > processes. this lets multithreaded applications compete unfairly with > single threaded applications. > > 3) Thread switching becomes expensive, because it is a full context > switch, requiring dropping into the kernel, switching one proc out, and > the other in. the only way to fix this is to optimize process > switching, which gets hard past a certain point. > > 4) each thread has all the kernel resources associated with a process, > so applications with many threads require a lot of kernel resources. > > all of these problems are basically cribbed right out of the paper, all > the mistakes are mine, not his. Yes, there are all problems in Linuxthreads, but not KSE nor my idea. Honestly my idea has more than several flaws, including things like blocking during open() and close()* (*over NFS) when accessing files. It's just that things like mysql and most threaded applications might benifit over the near trivial implementation of aio_/SIGPNP/sysVpoll almost as much as KSE. I really don't want to get into a big discussion about this. I had no intention of discrediting KSE project, the idea was that someone with some kernel programming skill and a couple of free weekends could improve on the uthread system while Jason continued on his quest for KSE. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message