Gang,

>> .....
>>     the intr handler.  But based on the man pages, it isn't explicitly
>>     stated that I can "pthread_wakeup_np" a thread that hasn't used
>>     pthread_suspend_np() to suspend itself.

> that's what I am doing and it looks like it is working.
> 
> Would really be nice to know if it just works by accident!

        A quick browse of the source shows that pthread_wakeup_np sends an
RTL_SIGNAL_WAKEUP to the thread then calls the scheduler.  The
RTL_SIGNAL_WAKEUP signal basically just marks the process as woken up
(computable).  The scheduler then finds the highest priority executable
thread to run.  Note that it does not check to see whether the thread is
suspended or not before setting the bit.

        Thus the only penalty of using this mechanism would be the time of
the extra run of the scheduler, which is not much.  Bare in mind, however,
that you have to be careful with the priorities.  The scheduler will select
the highest priority executable task and give it the CPU regardless of which
task you wake up.

Regards,

Steve Cohen
-- [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