> Does my thread really have to be periodic in order to use
> pthread_wait_np?
> I have created a thread that does something when my interrupt routine
> ends,
> and it isn't periodic but waits to be killed (woken up) by the isr.  Now
> i 
> see in the doco's for pthread wait that "the thread was previously
> marked for execution using pthread_make_periodic_np"  I think this is a
> mistatement?

No, it is correct.
However you have to decide what do you want. Thread have to be
started by ISR or it should run perodically in a "self-propelled" way.

A tipical periodic task looks like this:

thread_code()
{
        pthread_make_periodic_np(pthread_self(), start_time, period);
        for(;;) {
                do_something();
                pthread_wait_np();      // I wait for next period
        }
        // never reached
}


A tipical interrupt driven task is like this:

thread_code()
{
        for(;;) {
                pthread_suspend_np();   // ISR wakes me up by pthread_kill()
                                        // or pthread_wakeup_np()
                do_something();
        }
}
-- [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