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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to