Find the answer to your Linux question:
Results 1 to 3 of 3

Thread: Interrupts

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1


    Hi all

    What happens when an interrupt arrives while a task is performed by the kernel, does the interrupt get priority over the task?


  2. #2
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West
    This might help you get started:

    Understanding the Linux Kernel: Chapter 10: Process Scheduling

    Peace and Cheer.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Miven's link is good. Linux does have interrupt caused priority inversions (QNX does not). Interrupts are highest priority in the system. As long as the kernel task is not in an interrupt driver, it will be pre-empted by an interrupt until the interrupt handler is complete. As I understand, normally if an interrupt occurs while the kernel is inside another interrupt handler, it will be delayed until the first one is complete. This is why when you write interrupt handlers, you MUST be sure they do what they need, and return as quickly as possible, otherwise lost interrupts can occur.

    FWIW, as I understand it, QNX allows nested interrupts, so if a low-priority interrupt occurs, and while in its handler another higher priority interrupt occurs, its state is saved and the higher priority interrupt handler will run, thus preventing priority inversion (where a low priority task can delay a higher priority one). This is kind of necessary when running nuclear plants and fly-by-wire aircraft avionics systems. You don't want to delay shutting down the reactor going into meltdown when writing data to a disc or fail to adjust an aileron when the radio is turned on!

    These are subjects for advanced operating system design classes, usually at a graduate level.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts