Sched

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sched.h.html

Part of QRT Real-Time Kernel.

Defines

SCHED_FIFO (0x0100u)

FIFO scheduling policy.

SCHED_RR (0x0200u)

Round-robin scheduling policy.

SCHED_SPORADIC (0x0400u)

Sporadic scheduling policy. Not supported.

SCHED_OTHER (0x0800u)

Other scheduling policy. Not supported.

Functions

int sched_get_priority_max(int policy)

Return the highest priority value accepted by the scheduler.

The value is independent of policy.

Parameters:
  • policy – Scheduling policy. Ignored.

Returns:

Maximum priority value.

int sched_get_priority_min(int policy)

Return the lowest priority value usable by application threads.

The kernel’s idle thread sits below this value, so it is never returned. The value is independent of policy.

Parameters:
  • policy – Scheduling policy. Ignored.

Returns:

Minimum priority value.

int sched_yield(void)

Surrender the CPU to the next runnable thread of equal or higher priority.

If no such thread exists the call returns immediately and the caller keeps running.

Returns:

Always 0.

int sched_getparam(pid_t pid, struct sched_param *param)

Not supported.

Returns:

Always -1 and sets errno to ENOSYS.

int sched_getscheduler(pid_t pid)

Not supported.

Returns:

Always -1 and sets errno to ENOSYS.

int sched_rr_get_interval(pid_t pid, struct timespec *interval)

Not supported.

Returns:

Always -1 and sets errno to ENOSYS.

int sched_setparam(pid_t pid, const struct sched_param *param)

Not supported.

Returns:

Always -1 and sets errno to ENOSYS.

int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param)

Not supported.

Returns:

Always -1 and sets errno to ENOSYS.

struct sched_param
#include <sched.h>

Scheduling parameters for a thread.

Public Members

int sched_priority

Thread scheduling priority.