From owner-freebsd-threads@FreeBSD.ORG Tue Jul 8 17:29:11 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 EEF6737B401; Tue, 8 Jul 2003 17:29:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7322A43FB1; Tue, 8 Jul 2003 17:29:11 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from tiger (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h690T9Up078634; Tue, 8 Jul 2003 17:29:10 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <005101c345b1$8fdb7cc0$0701a8c0@tiger> From: "David Xu" To: , "John Baldwin" References: Date: Wed, 9 Jul 2003 08:32:20 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 cc: threads@freebsd.org Subject: Re: libc_r silliness X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2003 00:29:12 -0000 ----- Original Message -----=20 From: "Daniel Eischen" To: "John Baldwin" Cc: "David Xu" ; Sent: Wednesday, July 09, 2003 8:12 AM Subject: Re: libc_r silliness > On Tue, 8 Jul 2003, John Baldwin wrote: > > On 08-Jul-2003 Daniel Eischen wrote: > > > On Tue, 8 Jul 2003, John Baldwin wrote: > > >> So is X/Open OSI whoever just assuming that the process and = thread > > >> scheduling policies implement identical priority ranges? > > >=20 > > > I dunno, but it seems that is the case. > > >=20 > > > We could add pthread_get_priority_{min,max}_np(int policy) as > > > non-portable functions. > >=20 > > We could also just force all the thread libraries and kernel to > > use the same priority ranges. >=20 > I don't want to have SCHED_OTHER with -20 .. 20 in libpthread. >=20 > > 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. >=20 > I like this better than the other option, but how do you > know that when the application calls sched_setschedparam() > with a priority of 10, that it really came from > sched_get_priority_min() + 10 (meaning -10) or whether it was > hardcoded to 10 and really wants 10. >=20 >From a book "Programming for the real world POSIX.4", The author said about sched_get_priority_max/min: Notes: Since the range of scheduling priorities varies from system to system, applications should refrain from calling the POSIX.4 scheduling algorithms with straight priority numbers. Rather, a virtual priority range should be used; then it should be = shifted appropriately based on the values returned from = sched_get_priority_min and sched_get_priority_max. > --=20 > Dan Eischen >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" >