From owner-freebsd-threads@FreeBSD.ORG Tue Jul 8 17:01:14 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBF2E37B404 for ; Tue, 8 Jul 2003 17:01:14 -0700 (PDT) Received: from mail.speakeasy.net (mail8.speakeasy.net [216.254.0.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81FA243FB1 for ; Tue, 8 Jul 2003 17:01:13 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 25361 invoked from network); 9 Jul 2003 00:01:12 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 9 Jul 2003 00:01:12 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h6901AGI097240; Tue, 8 Jul 2003 20:01:11 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Tue, 08 Jul 2003 20:01:24 -0400 (EDT) From: John Baldwin To: deischen@FreeBSD.org cc: David Xu cc: threads@FreeBSD.org Subject: Re: libc_r silliness X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2003 00:01:15 -0000 On 08-Jul-2003 Daniel Eischen wrote: > On Tue, 8 Jul 2003, John Baldwin wrote: >> >> On 08-Jul-2003 Daniel Eischen wrote: >> > Actually, is marked PS, not TPS, and the text of >> > the page talks about "process": >> > >> > Each process is controlled by an associated scheduling policy >> > and priority. Associated with each policy is a priority range. >> > Each policy definition specifies the minimum priority range for >> > that policy. The priority ranges for each policy may overlap >> > the priority ranges of other policies. >> > >> > Regardless, we have kernel scheduling parameters _and_ thread >> > scheduling parameters. From my interpretation, these interfaces >> > refer to the process scheduling, not thread scheduling. >> > This is a good link too: >> > >> > http://www.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_08.html#tag_02_08_04_01 >> > >> > Each process shall be controlled by an associated scheduling policy >> > and priority. These parameters may be specified by explicit >> > application execution of the sched_setscheduler() or >> > sched_setparam() functions. >> > >> > Each thread shall be controlled by an associated scheduling policy >> > and priority. These parameters may be specified by explicit >> > application execution of the pthread_setschedparam() function. >> >> So is X/Open OSI whoever just assuming that the process and thread >> scheduling policies implement identical priority ranges? > > I dunno, but it seems that is the case. > > We could add pthread_get_priority_{min,max}_np(int policy) as > non-portable functions. We could also just force all the thread libraries and kernel to use the same priority ranges. Another possibility is to have each thread library provide their own sched_get_{min,max} and wrap the sched_{get,set}schedparam() syscalls to massage the thread priority values into their corresponding process priority values to simulate a single priority space for each policy. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/