soft real-time scheduling

Bud Davis bdavis9659@comcast.net
Sun Sep 26 14:52:00 GMT 2004


first off, this list is for gcc, not general programming.

p needs to have storage allocated. here is a safer way to do it:

#include <sched.h>
#include <stdio.h>
 
int main ()
{
   struct sched_param p;
 
 /* set soft real-time scheduling */
   sched_getparam(0,&p);
   p.sched_priority = 50;
   if (sched_setscheduler(0,SCHED_FIFO,&p))
     fprintf(stderr,"Could not change scheduler settings\n");
 
   return 0;
}


HTH,
bud davis



More information about the Gcc-help mailing list