Tuesday, 22 November 2011

Real time scheduling

Main worker threads will have been pinned to cores. Now we need to prevent them from being preempted.

Set the scheduler type to SCHED_FIFO, and set the thread priority to maximum


#include <sched.h>


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

struct sched_param {
    ...
    int sched_priority;
    ...
};

int sched_get_priority_max(int policy);

http://linux.die.net/man/2/sched_setscheduler
http://linux.die.net/man/2/sched_get_priority_max

No comments:

Post a Comment