From owner-freebsd-threads@FreeBSD.ORG Tue Jul 8 23:22:03 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 1BCCA37B401; Tue, 8 Jul 2003 23:22:03 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 700F343FBF; Tue, 8 Jul 2003 23:22:02 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38ldtos.dialup.mindspring.com ([209.86.247.28] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19a8L3-0000P0-00; Tue, 08 Jul 2003 23:22:01 -0700 Message-ID: <3F0BB44C.FB24CBE5@mindspring.com> Date: Tue, 08 Jul 2003 23:21:00 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin References: <3F0A9E8E.99CA9BD@mindspring.com> <200307080923.20011.jhb@FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a44ae6e18bab27483bff5267826351b4fd350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: deischen@FreeBSD.org 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 06:22:03 -0000 John Baldwin wrote: > On Tuesday 08 July 2003 06:35 am, Terry Lambert 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": > > 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()? The functions sched_getparam(), sched_setparam() are listed as cross-references, while pthread_setschedparam() is not. It's probably also useful to look at the pthread_setschedparam() cross-references, which include pthread_setschedprio(). The page for that function contains a rationale section, and references the System Interfaces, Section 2, bsection "Scheduling Policies": It specifically states that there shall be a minimum specified, but that the maximum is implementation defined. This reinforces the idea that sched_get_priority_max() is meaningful to sched_* functions, but not in pthread_* functions. I suppose if you wanted to get technical on meaning, you could *maybe* interpret the results in the context of whether or not the calling thread was "scope process" or "scope system", and return a meaningful value under those circumstances. Of course, that would be evil. 8-). Personally, I would note that the extension sections the set commands are located in are disjoint, and that you are probably in territory that's, at best, "implementation defined", when it comes to trying to find allowable argument values for pthread_setschedparam(). -- Terry