From owner-freebsd-threads@FreeBSD.ORG Tue Jul 8 16:38:41 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 4843237B401; Tue, 8 Jul 2003 16:38:41 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F38D43F93; Tue, 8 Jul 2003 16:38:40 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h68NcbAI005883; Tue, 8 Jul 2003 19:38:39 -0400 (EDT) Date: Tue, 8 Jul 2003 19:38:37 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Xu In-Reply-To: <001201c3459c$f0f66480$0701a8c0@tiger> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: John Baldwin Subject: Re: libc_r silliness X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2003 23:38:41 -0000 On Wed, 9 Jul 2003, David Xu wrote: > > From: "John Baldwin" > > > On Tuesday 08 July 2003 06:35 am, Terry Lambert wrote: > > > Daniel Eischen wrote: > > > > I have not found anything yet regarding sched_get_priority_{min,max} > > > > confusion in the POSIX spec... > > > > > > http://www.opengroup.org/onlinepubs/007904975/functions/sched_get_priority_ > > >max.html > > > > > > The functions take a policy parameter; they are supposed to > > > return "appropriate" values, which I took to mean "appropriate > > > to the policy parameter supplied at the time they were called": > > > > > > int sched_get_priority_max(int policy); > > > int sched_get_priority_min(int policy); > > > > > > The sched_get_priority_max() and sched_get_priority_min() > > > functions shall return the appropriate maximum or minimum, > > > respectively, for the scheduling policy specified by policy. > > > > Yes, but in a multithreaded program when I call > > sched_get_priority_max(SCHED_RR), does that tell me the maximum process > > SCHED_RR priority for use with sched_setschedparam() or does it tell me the > > maximum thread SCHED_RR priority for use with pthread_setschedparam()? > > > See page: > http://www.opengroup.org/onlinepubs/007904975/basedefs/sched.h.html > They are marked with 'TPS' code, so they are applied to thread scheduling. > Otherwise, they should be marked with 'PS' code. 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. -- Dan Eischen