Skip to contentSkip to conversation

soft real-time scheduling

DISCUSSION Ankit Jain 3 participants 3 messages Sep 26, 2004

lore
Share & tools
lore

Ankit Jain

author
#0 lore raw

hi

/* soft realtime scheduling variable */
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");

if anyone knows about this then i need some help

p is a pointer to the structure sched_param which is defined in sched.h

this structure has a variable __sched_priority where i have to set the priority of the process

p->sched_priority =50 this line gives a segmentation fault.
how t oaccess this variable (__sched_priority) of the header file

thanks

ankit

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html

#1 lore raw

Hi, This is offtopic for this list.

from http://gcc.gnu.org/lists.html

"gcc-help is a relatively high volume list for people searching for help in building or using GCC."

Anyway, for your question... i see few problems

1.    struct sched_param *p;
    sched_getparam(0,p);

Using unallocated memory. will result in SEGV

2. When you get 1 corrected, you may get another error From man 2 sched_setscheduler
<snip>
EPERM The calling process does not have appropriate privileges. <snip>

Quoted 35 lines · Ankit Jain

hi

/* soft realtime scheduling variable */
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");

if anyone knows about this then i need some help

p is a pointer to the structure sched_param which is defined in sched.h

this structure has a variable __sched_priority where i have to set the priority of the process

p->sched_priority =50 this line gives a segmentation fault.
how t oaccess this variable (__sched_priority) of the header file

thanks

ankit

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html