Subject: Re: pthread_attr_setschedpolicy of pthread
To: Ian Zagorskih <ianzag@megasignal.com>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: tech-userlevel
Date: 12/28/2004 19:42:14
Ian Zagorskih <ianzag@megasignal.com> writes:

> On Tuesday 28 December 2004 18:24, Rui Paulo wrote:
> > On 2004.12.27 11:46:23 +0000, Nicolas Joly wrote:
> > > I think we need both.
> > >
> > > Currently, a lot of programs use `pthread_attr_setschedpolicy' (like
> > > NBCI blast, in my case). It will be great if they can compile out of
> > > the box, instead of hacking them.
> >
> > I'm not aware of the standards, but where does
> > pthread_attr_setschedpolicy() come from ? Is it Linux specific ?
> > Also, Linux does have pthread_setschedparam().
> >
> 
> It's in POSIX/RT THREADS now:
> 
> http://www.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getschedpolicy.html

It's not really new, but a program that uses these functions should
check that they exist (with the _POSIX_THREAD_PRIORITY_SCHEDULING CPP
symbol), since they're optional parts of POSIX.

I'll see about cooking up some stubs for programs that can't be
bothered to check.

        - Nathan