next up previous contents index
Next: 25.6.10 create_lotto_scheduler: Create a Up: 25.6 CPU Inheritance Framework Previous: 25.6.8 Example Schedulers

25.6.9 create_fixedpri_scheduler: Create a fixed priority scheduler

 

SYNOPSIS

#include <oskit/threads/pthread.h>
#include <oskit/threads/cpuinherit.h>

int create_fixedpri_scheduler(pthread_t *tid, const pthread_attr_t *attr, int preemptible);

DESCRIPTION

Create a new Fixed Priority scheduler. The pthread_t of the new scheduler is returned in tid. The attributes structure to use when creating the new thread is attr. The preemptible flag indicates whether the new scheduler should use time-based preemption to achieve fairness. Aside from the usual attributes that can be specified, the caller may also specify the new scheduler's scheduler by using pthread_attr_setscheduler. Thus, the caller can set up an arbitrary hierarchy of schedulers and threads.

This fixed priority scheduler roughly corresponds to the POSIX pthread scheduler, and implements both FIFO and round robin policies. The standard pthread scheduling interface routines may be used when altering the scheduling parameters for threads that are scheduled by this scheduler.

PARAMETERS

tid
A pointer to the location where the thread id of the new scheduler should be stored.
attr
A pointer to the thread creation attributes object.
preemptible
A flag indicating whether the new scheduler should use time-based preemption.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



Utah Flux Research Group