Ken,

Which version of RTLinux do you use?

Michael.

Ken Teh ([EMAIL PROTECTED]) wrote:
> I apologize if this sounds confused; it's because I am.
> 
> I'm trying to understand how thread dispatching works.  Using the sound
> example, I wrote an IRQ handler that does the following:
> 
> irq_handler()
> {
>     clear_hardware_irq();
>     pulse_output();
>     rtl_hard_enable_irq(x);
> }
> 
> Everything works fine.  I look on my scope and can measure the time between
> the input pulse that causes the interrupt and the output pulse from
> pulse_output().
> 
> >From the same sound example, I then tried a variation where a thread is
> dispatched from the handler, ie.
> 
> irq_handler()
> {
>     pthread_wakeup_np(thread);
>     clear_hardware_irq();
>     rtl_hard_enable_irq(x);
> }
> 
> and my thread looks like
> 
> void *my_thread(void *param)
> {
>     rtl_stop_interrupts();
>     while (1) {
>       pthread_suspend_np(pthread_self());
>       pulse_output();
>     }
> }
> 
> When I look on the scope I see 2 output pulses about 10usec apart, instead
> of the expected 1 which I saw with the previous version.  Since I don't have
> a capture scope where I can freeze, I cannot say for certain there were
> actually 2 pulses.  But it sure looks this way.  Only way for this to happen
> is if the thread ran twice.  Not possible, is it?
> 
> As a afternote, the system cannot be interrupted twice because the input
> that generated the interrupt is vetoed until I do pulse_output() which
> removes the veto.  In any case the input rate is too slow.
> 
> -- [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/
-- [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