Getting my priorities straight

How do I set the priority of a process?
The “setprio()” function is not recommended for new development. What
replaces it?

Chris Rose <chris.rose@viasat.com> wrote:
: How do I set the priority of a process?
: The “setprio()” function is not recommended for new development. What
: replaces it?

The docs now suggest using sched_setparam() or pthread_setschedparam().


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Steve Reid <stever@qnx.com> wrote:

Chris Rose <> chris.rose@viasat.com> > wrote:
: How do I set the priority of a process?
: The “setprio()” function is not recommended for new development. What
: replaces it?

The docs now suggest using sched_setparam() or pthread_setschedparam().

Plus, at some point you’re setting thread priorities, not process priorities.
The thread that starts at main() sorta-kinda looks like the “process” if you
want to think of it that way…

So, you’d also want to look into pthread_attr_t structure and friends for
pthread_create().

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.