The maximum length of time interrupts are disabled

Angelo Fraietta afraiett at
Mon Mar 8 18:02:04 UTC 2004

Fabrizio Sebastiani wrote:

> Hi all,
>     I have a question a general arch-indipendent question (Im using 
> sparc-rtems 4.0.0 for ERC32)
> about the maximum length of time interrupts are disabled, regarding 
> invocation of rtems_interrupt_{disable,enable} routines.
>     My question is how can I be sure that one critical section never 
> miss an interrupt?
>     Suppose to have such a tipical code:
> rtems_isr_level il;
> rtems_interrupt_disable(il);
> // ... critical section ....
> rtems_interrupt_enable(il);
>     Its clear to me that critical section have to perform the minimum 
> actions in order to be "fast";
>     Suppose that an interrupt comes while the CPU is executing the 
> critical section.
> How i can be sure that my critical section does not take too much time 
> before the re-enabling of the interrupt? How i can be sure that no 
> critical sections will
> miss some interrupt that was coming inside them?
>     I found some infos in the RTEMS docs:
>     For example, as explained in 
>     says that I should have a look at the spart architecture supplement:
>     In this link there is only a statement that is obscure to me and 
> it doesnt seem to answer to my original question:

I had this vey problem in that I missessome interrupts because I 
disabled interrupts, when All I needed to do was modify what I was doing.
First see if you need to disable interrupts. If you just want to stop 
another task from being prempted, I think that you can change the 
priority of your task to be the highest (check on that)
If you need to disable interrupts, make sure the code that s within that 
section is as small as possible.

Here asre a couple of articles that I found helpful.

Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)

More information about the users mailing list