On Tue, May 09, 2000 at 10:12:43AM -0500, daniel sheltraw wrote:
> I have setup an ISR that accepts hardware interrupts from another
> device via the parallel port. The ISR simply increments a counter. I would 
> like to produce a pause in the task when the counter reaches a certain value 
> and restart the task at another counter value. This
> should be done without a busy wait checking the value of the counter.

Here's on way.
/* note that if "thread" is running when the SUSPEND is sent, it
   will continue to run until it times out or calls the scheduler */

interrupt_handler:
         count++;
         if(should_stop(count))
                 pthread_kill(thread,RTL_SIG_SUSPEND); 
         else if(should_restart(count))
                 pthread_kill(thread,RTL_SIG_WAKEUP);

         
> 
> Any clarifications on using suspend/resume routines to control the task 
> within an ISR. Any other suggestions? Semaphores were
> suggested. Does anyone have a code snippet for a semaphore approach?
> 
> Thanks everyone,
> Daniel
> 
> 
> >From: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [rtl] RT interrupt service routine question
> >Date: Tue, 09 May 2000 16:31:47 +0200 (MET DST)
> >
> >
> > > > pthread_wakeup_np() is safe. The others are unknown (yet).
> > >
> > > pthread_suspend_np  is safe, but may suspend the interrupt handler.
> >
> >Folks,
> >
> >"Safe" just means: it won't crash your machine (immediately).
> >It not equal to "useful" or "wise".  ;-)
> >
> >
> >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/
> >
> 
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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/

-- 
---------------------------------------------------------
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/

Reply via email to