Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2001 23:59:57 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Peter Haight <peterh@sapros.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: pthread_attr_setschedparam, mozilla, and PTHREAD_MAX_PRIORITY
Message-ID:  <Pine.SUN.3.91.1010110235431.26221A-100000@pcnet1.pcnet.com>
In-Reply-To: <200101110441.f0B4fe008116@wartch.sapros.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 10 Jan 2001, Peter Haight wrote:
> I rebuilt mozilla after upgrading to 4.2 and was getting an assertion
> because pthread_attr_setschedparam() was failing with a ENOTSUP. It turns
> out Mozilla was trying to set the thread priority to 42 which is above the
> new limit of 31 which changed a little before 4.2-RELEASE.
> 
> To patch mozilla I had to do a '#if __FreeBSD_version >= 420000' because
> PTHREAD_MAX_PRIORITY is in a private pthreads header file. I'm wondering if
> it might not be a good idea to have that define show up somewhere public?
> The only other thing I can think of is to call pthread_attr_setschedparam()
> a couple of times to scope out the range of accepted values.

As far as I read the POSIX spec, this is not exported.  I'll have a look
at it again when I get the chance.

That said, POSIX only guarantees priorities in the range 0-31 (which is
what we now allow).  The exception is for SCHED_OTHER which can be
implementation defined.  Either way you look at it, it seems that a
properly coded threaded application ought to rely on priorities in
the range 0-31 (for non-SCHED_OTHER), or should scope them out at 
run-time.

-- 
Dan Eischen



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010110235431.26221A-100000>