From owner-freebsd-arch Wed Nov 24 11:29:30 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 979C71534C for ; Wed, 24 Nov 1999 11:29:24 -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 UAA08938 for ; Wed, 24 Nov 1999 20:29:24 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id UAA35350 for freebsd-arch@freebsd.org; Wed, 24 Nov 1999 20:29:24 +0100 (MET) Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id C3154152CF for ; Wed, 24 Nov 1999 11:29:12 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id OAA02394; Wed, 24 Nov 1999 14:29:12 -0500 (EST) Date: Wed, 24 Nov 1999 14:29:12 -0500 (EST) From: Daniel Eischen To: Matthew Dillon Cc: Matthew Dillon , "Daniel C. Sobral" , Julian Elischer , "Daniel M. Eischen" , freebsd-arch@freebsd.org Subject: Re: Threads In-Reply-To: <199911241905.LAA20045@apollo.backplane.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, Matthew Dillon wrote: > :In this context, what is a task? Something similar to a kernel thread? > :If there are N (user-level POSIX) threads in an application, how many > :tasks are there? > > N. A task is simply an execution context for the scheduler. That's it, > nothing special. The scheduler need only know about tasks and doesn't > really have to know about meta-data such as (except for the MMU context) > data stored in Processes, nor does it really need to know what *kind* > of task it is messing with. > > Simplicity is the best solution. > > :> complicates the code. We can trivially use the existing priority > :> scheme to schedule interrupt tasks (threads). > : > :The kernel doesn't know at what priority the threads run, so how can > :it effectively schedule them? > : > :Dan Eischen > > If you have one Task == one Thread, the priority is in the Task > structure, so the kernel would know. Obviously the scheduler must know > or it can't properly schedule the execution context. So everytime the UTS wants to run a new thread, it has to make a call to the kernel to tell it what it's current priority is? And the kernel is suppose to be able to handle SCHED_FIFO and SCHED_RR queueing? And the kernel will now if a task holds a critical resource and will be able to avoid priority inversions? 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. Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message