Sched_setschuler SCHED_FIFO

Hi,
i’m looking for an example of some opengl code that uses sched_setschedule. I have a program that records the time between an opengl object disappearing from the screen, and a button press by the player. I want to develop my programms such that calls between gettimeofday() at object disappearance and button press (typically between 400 and 1200ms) are not interupted by other running processes. i’ve looked at the man pages, but am not experienced enough to implement sched_setscheduler into a working openGL program. any advice or working examples greatly appreciated

Simon

FIFO won’t be the thing you’re looking for… It’s the default one when you don’t explicitly specify with setScheduler.

One big problem before you want to switch to real-time mode under Linux is that X does not run at real time. So, it’s a bit dangerous to have a fullscreen gl and still a window. You could hang your system that will lead all events to your prog, and X never able to move… This could product a freeze that only some system calls may stop.

You may want to do some thing like me (cf my post). I have a separate thread for keyboard, but is not always running in RT due to this problem.
You could first try out of X in simple console mode. This will permit you to be forged a bit. But, i advise you to lool for how the things works (some could be found on the net).

hope this helps.

jide

hi jide,
thanks for your reply.

[QUOTE]Originally posted by jide:
[b]FIFO won’t be the thing you’re looking for… It’s the default one when you don’t explicitly specify with setScheduler.

ok. so do you suggest SCHED_RR is more appropriate. which one do you use? why?

One big problem before you want to switch to real-time mode under Linux is that X does not run at real time. So, it’s a bit dangerous to have a fullscreen gl and still a window. You could hang your system that will lead all events to your prog, and X never able to move… This could product a freeze that only some system calls may stop.

yes, I am experiencing this problem at the moment. If i have sched_setscheduler call in main(), or init(), then animations will run, but the keyboard inputs are blocked, and i cannot get my timing information.

You may want to do some thing like me (cf my post). I have a separate thread for keyboard, but is not always running in RT due to this problem.

this sounds exactly like what I need. a separte thread for the keyboard that has high sheduling priority. however, I am not an experienced programmer, and am not familiar with programming separate threads.

i took a look at your post, and visited your website. however, i was unable to find source code. If possible, could you please send me an example of your program with the separate thread for keyboard, the calls to sched_setscheduler(), and the call to the keyboard thread? hope i’m not asking for too much here.

cheers,
Simon

Originally posted by shosking:
[b]hi jide,
thanks for your reply.

[QUOTE]Originally posted by jide:
[b]FIFO won’t be the thing you’re looking for… It’s the default one when you don’t explicitly specify with setScheduler.

ok. so do you suggest SCHED_RR is more appropriate. which one do you use? why?

One big problem before you want to switch to real-time mode under Linux is that X does not run at real time. So, it’s a bit dangerous to have a fullscreen gl and still a window. You could hang your system that will lead all events to your prog, and X never able to move… This could product a freeze that only some system calls may stop.

yes, I am experiencing this problem at the moment. If i have sched_setscheduler call in main(), or init(), then animations will run, but the keyboard inputs are blocked, and i cannot get my timing information.

-> not really nice, isn’t it ?

You may want to do some thing like me (cf my post). I have a separate thread for keyboard, but is not always running in RT due to this problem.

this sounds exactly like what I need. a separte thread for the keyboard that has high sheduling priority. however, I am not an experienced programmer, and am not familiar with programming separate threads.

-> I think you don’t understand well all principles: if your keyboard has the higher scheduler prior, then any other things will be slow down. If you’re not familiar, I advise you to learn before trying such a thing… quiete dangerous… and blinded forward…

i took a look at your post, and visited your website. however, i was unable to find source code. If possible, could you please send me an example of your program with the separate thread for keyboard, the calls to sched_setscheduler(), and the call to the keyboard thread? hope i’m not asking for too much here.

-> I’m in C++, my threading part is about 3000 to 5000 lines, so I don’t think this is the best solution for you.
And as it’s not an opengl post, you could (as you already done) wrote me. we may discuss of all that;

cheers,
Simon[/b]

regards

Fratt

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.