I have an application that is a cpu emulator.  It is for the most part working and 
without problems.

When the emulated cpu runs a cpu diagnostic that checks timing, there are some time 
critical issues
that I think would be solved by raising my priority with a call to 
sched_setscheduler() using SCHED_FIFO
to keep the cpu for the time of the diagnostic test (usually anywhere from 2 ms to 5 
seconds).  This
would prevent the loss of the cpu at a time critical portion of the test (the 
diagnostic in question fails
intermittantly 1 out of 3 times).    I think the failures that have been seen is a 
quick context switch that
causes the interrupt to occur a little faster than is expected (the context switch 
uses up a little time that
the emulated cpu would have executed its software timing loop, hence the count is 
smaller than expected).

I tried calling sched_setscheduler() to set my priority to 1 and the mode to 
SCHED_FIFO both as root and
also with a chmod to suid the small program.  The program fails with perror() printing 
"Operation not permitted"
which is EPERM.   I would have thought that as a root user this would not happen.   

I was testing with RH 6.2 and 2.2.14 kernel, is sched_setscheduler() broken in that 
kernel?

Does anyone have a sample bit of code that does the call?



Best regards. 

Tony Preston
Cancer is Curable, Ask me why!
[EMAIL PROTECTED]
2003-04-03




-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to