On Tue, May 09, 2000 at 08:51:24AM +0200, [EMAIL PROTECTED] wrote:
> > Howdy RTL/RTAI comrades
> >
> > Can one do a rt_task_suspend and rt_task_resume within a RT interrupt
> > service routine?
>
> rt_task_resume? :-o
> What version has this function?
>
> pthread_wakeup_np() and pthread_suspend_np() are safe to use from
> an IT handler. rt_task_suspend() detto.
> See http://gatling.aszi.sztaki.hu/~kissg/doc_nmt/context.html
They are safe,but they may not do what you intend.
pthread_suspend_np -- suspend the named thread _and_ call the scheduler
So pthread_suspend_np(p) will suspend "p"
thread and call the scheduler. If you do this in a interrupt
handler it's possible that the interrupt handler will be suspended as
well! This will certainly happen if p==pthread_self() and may happen
if a higher priority thread is runnable.
While you may want this semantics, the clean way to do thread wakeup
and suspend is with pthread_kill which delivers the signal but does not
resched. The problem here is that pthread_kill(p,RTL_SIG_SUSPEND) may
not have immediate effect, but in most cases, what you want is for the
task that is waiting to do a pthread_suspend_np(pthread_self())
and for the interrupt routine to do pthread_kill(p,RTL_SIG_WAKEUP);
>
> BTW. Any contribution is welcome! :-)
>
> Gabor
> -- [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/
--
---------------------------------------------------------
Victor Yodaiken
FSMLabs: www.fsmlabs.com www.rtlinux.com
FSMLabs is a servicemark and a service of
VJY Associates L.L.C, New Mexico.
-- [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/