From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 28 08:26:17 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2E0D16A4CE for ; Mon, 28 Feb 2005 08:26:17 +0000 (GMT) Received: from pimout1-ext.prodigy.net (pimout1-ext.prodigy.net [207.115.63.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6EFDB43D5E for ; Mon, 28 Feb 2005 08:26:17 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [192.168.1.103] (adsl-68-123-122-107.dsl.snfc21.pacbell.net [68.123.122.107])j1S8QESJ173276; Mon, 28 Feb 2005 03:26:15 -0500 Message-ID: <4222D5A2.9010301@elischer.org> Date: Mon, 28 Feb 2005 00:26:10 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050214 X-Accept-Language: en, hu MIME-Version: 1.0 To: Ashwin Chandra References: <001a01c51d6d$d50ce500$abe243a4@ash> In-Reply-To: <001a01c51d6d$d50ce500$abe243a4@ash> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: sched_4BSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2005 08:26:18 -0000 Ashwin Chandra wrote: > I wanted to get some clarification about the 4BSD scheduler. I am sort of > confused why there are two forms of scheduling, one done between processes and > another done between threads in a process. The priority calculations seem to be > done only with processes and I assume that the global run queue holds processes, > not threads. Also why is there only 1 run queue for 1 CPU. What happens to > blocked processes and ready to be runned processes? Part of the challenge of adding threads to a system is to make it hard for a threaded process to "flood" the system run queues so that other processes get no cpu time. The scheme in the current freeBSD schedulers is a "crude" method, by which only a limitted number of threads per process are allowed to be added to the system run queue. RUnnable hreads fo r aprocess are kept on a run queue for the process and only the highest N prioriy hreads are actually put on the system run queue. This is by no means the best way, but rather the easiest way. I am hoping that some PhD candidate somewhere will decide that thread scheduling is his topic and will figure out a better way of doing this. both run queues hold threads. This is still a place wjere a lot of work can be done. :-) > > Ash > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"