Set the scheduling policy for a thread
#include <sys/neutrino.h> int SchedSet( pid_t pid, int tid, int policy, const struct sched_param *param ); int SchedSet_r( pid_t pid, int tid, int policy, const struct sched_param *param );
If either the SCHED_ADJTOHEAD or SCHED_ADJTOTAIL options is set, then the struct sched_param field is ignored. |
For more information, see “Thread scheduling” in the QNX Neutrino Microkernel chapter of the System Architecture guide.
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The SchedSet() and SchedSet_r() kernel calls set both the scheduling policy and the associated parameters for the thread specified by tid in the process specified by pid. If pid is zero the current process is used to look up a nonzero tid. If tid is zero, then the calling thread is used and pid is ignored.
These functions are identical except in the way they indicate errors. See the Returns section for details.
Instead of using these kernel calls directly, consider calling pthread_setschedparam() or pthread_setschedprio(). |
These calls don't block.
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
pthread_setschedparam(), pthread_setschedprio(), sched_get_priority_max(), sched_get_priority_min(), sched_param, SchedGet(), SchedInfo(), SchedYield()
“Thread scheduling” in the QNX Neutrino Microkernel chapter of the System Architecture guide
“Scheduling policies” in the Programming Overview chapter of the QNX Neutrino Programmer's Guide