From owner-freebsd-threads@FreeBSD.ORG Tue Jul 8 15:21:50 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 3A80037B401 for ; Tue, 8 Jul 2003 15:21:50 -0700 (PDT) Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A0B743F93 for ; Tue, 8 Jul 2003 15:21:49 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 8260 invoked from network); 8 Jul 2003 22:21:48 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 8 Jul 2003 22:21:48 -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 h68MLhGI096996; Tue, 8 Jul 2003 18:21:44 -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: <001201c3459c$f0f66480$0701a8c0@tiger> Date: Tue, 08 Jul 2003 18:21:58 -0400 (EDT) From: John Baldwin To: David Xu 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: Tue, 08 Jul 2003 22:21:50 -0000 On 08-Jul-2003 David Xu wrote: > > ----- Original Message ----- > From: "John Baldwin" > To: "Terry Lambert" ; > Cc: > Sent: Tuesday, July 08, 2003 9:23 PM > Subject: Re: libc_r silliness > > >> On Tuesday 08 July 2003 06:35 am, Terry Lambert wrote: >> > Daniel Eischen wrote: >> > > On Mon, 7 Jul 2003, John Baldwin wrote: >> > > > > I don't really know how to handle this. We can wrap >> > > > > sched_get_priority_{min,max}(), but how do we know whether >> > > > > the application wants process priorities or thread >> > > > > priorities? >> > > > >> > > > Ugh. Perhaps the manpage should at least be updated to not >> > > > reference the macros. What does POSIX say about the confusion >> > > > between sched_get_priority_{min,max}? >> > > >> > > Sure, update the man pages if you want ;-) >> > > >> > > 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. > This is the code page: > http://www.opengroup.org/onlinepubs/007904975/help/codes.html Hmm, then why do we have these in the kernel? Shouldn't these be implemented in each thread library instead? Was this another one of the hacks to make LinuxThreads work? It sounds like each threading library should provide these functions and the kernel has no business supplying them. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/