interrupt handling

In the documentation for InterruptAttachEvent( ) it is mentioned that the
InterruptAttachEvent performs a InterruptMask operation. The documentation
further states that we should avoid using InterruptMask and InterruptUnmask
in the case of SMP. And try to use InterruptLock and InterruptUnlock
instead.

Does this mean that InterruptAttachEvent should be avoided under SMP.

Am i missing something here.

Please advice

Thanks
Dennis

Dennis <dmoses@z-kat.com> wrote:

In the documentation for InterruptAttachEvent( ) it is mentioned that the
InterruptAttachEvent performs a InterruptMask operation. The documentation
further states that we should avoid using InterruptMask and InterruptUnmask
in the case of SMP. And try to use InterruptLock and InterruptUnlock
instead.

Does this mean that InterruptAttachEvent should be avoided under SMP.

Please say exactly where - I couldn’t find it when I looked in the 6.1
documentation. What I did find (and is correct) is that InterruptEnable()
and InterruptDisable() should be avoided. InterruptMask and InterruptUnmask()
are fine on SMP.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

http://qdn.qnx.com/support/docs/neutrino_2.11_en/sys_arch/smp.html#CRITICAL

I tried out interruptmask and it works just fine. I think i misinterpreted
the documentation.
Sorry,

Dennis



“Brian Stecher” <bstecher@qnx.com> wrote in message
news:a89m3k$fnd$1@nntp.qnx.com

Dennis <> dmoses@z-kat.com> > wrote:
In the documentation for InterruptAttachEvent( ) it is mentioned that
the
InterruptAttachEvent performs a InterruptMask operation. The
documentation
further states that we should avoid using InterruptMask and
InterruptUnmask
in the case of SMP. And try to use InterruptLock and InterruptUnlock
instead.

Does this mean that InterruptAttachEvent should be avoided under SMP.

Please say exactly where - I couldn’t find it when I looked in the 6.1
documentation. What I did find (and is correct) is that InterruptEnable()
and InterruptDisable() should be avoided. InterruptMask and
InterruptUnmask()
are fine on SMP.


Brian Stecher (> bstecher@qnx.com> ) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M
1W8

Dennis <dmoses@z-kat.com> wrote:

http://qdn.qnx.com/support/docs/neutrino_2.11_en/sys_arch/smp.html#CRITICAL

I tried out interruptmask and it works just fine. I think i misinterpreted
the documentation.

It does work, in the sense that it masks the interrupt; what the docs
are trying to say is that on a multiprocessor, masking an interrupt
doesn’t reliably prevent the interrupt handler from clobbering your
variables like it does on a single processor. If you call
InterruptMask() just after another processor has received the interrupt,
your handler might run (on the other processor) after InterruptMask()
has returned.

With InterruptAttachEvent(), it’s less of a problem because it’s less
surprising that your event may arrive after you’ve masked the interrupt,
even on a single processor. You simply have no way to tell whether the
interrupt was handled just before or just after you masked it…


Wojtek Lerch QNX Software Systems Ltd.

Thanks for the explaination.


With InterruptAttachEvent(), it’s less of a problem because it’s less
surprising that your event may arrive after you’ve masked the interrupt,
even on a single processor. You simply have no way to tell whether the
interrupt was handled just before or just after you masked it…

Wojtek Lerch QNX Software Systems Ltd.