Hi!

Is there a way to detect (and prevent) the CPU overload in RT thread?
I've found no solutions in the archive.

Would something like this work?

while(1) {
        ret = pthread_wait_np();
        start_time = gethrtime();
        
        if (overload++) {
                suspend thread!
        }
        
        // Do some RT work.
        rt_step();

        rt_step_count++;
        rt_task_spent_time += gethrtime() - start_time;

        overload--;
}


If the  rt_step takes too long to finish, what exactly happens?
The idea is to skip (miss) the overload--;


Is there any better solution to this overloading problem?


Ales
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to