On Mon, Mar 05, 2001 at 12:08:11PM -0500, Stephen D. Cohen wrote:
> 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.
Steve,
Thanks for the info - I guess I was looking for an answer as to
whether this is "correct" to do. As Heinz mentioned, calling
pthread_wakeup_np() _does_ work, however, I've been occasionally
bitten by coding to the internal implementation (as opposed to
coding to the external interface.)
I guess I'll go ahead and do it, with a big comment in my code :-)
Thanks again,
Eric
--
Give me liberty or give me death! -- Patrick Henry
Eric Peterson WB6PYK (805)370-3046 mailto:[EMAIL PROTECTED]
http://www.troikanetworks.com
-- [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/