RE: soft real-time scheduling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux