What is difference between top half and bottom half ?

  • 2

    How interrupts being handled top half and bottom half ?

  • 8

    The bottom half will acknowledge the interrupt, queue actions for processing and return the processor to what it was doing quickly. The top half will then run later when the CPU is free and do the more intensive processing. This is to stop an interrupt hogging the entire CPU.

  • 9

    @the_killer My understanding is that it is the TOP half that acknowledges the interrupt, etc. and BOTTOM half will run later to do most of the work.

  • 1

    @the_killer incorect explanation

  • 2

    @the_killer This is not really accurate, concepts are inverted. High-priority interrupt requests are acknowledged and handled by the interrupt handler in the top-half, and the handler needs to complete its work quickly. Lower priority IRQs are scheduled for a future time (definition of future time is specific to the OS) when the processor has bandwidth, this is the bottom-half, aka DPC (Deferred Procedure Call) in the Windows world.

  • 0

    Interrupt handlers run asynchronously, and must respond to time-critical inputs quickly. Therefore, interrupt handler is divided into top half and bottom half. First half was executed by the kernel immediately after a hardware interrupt, whereas bottom half are the tasks that can be deferred to execute later.

  • 0

    I think one difference is top half is in interrupt context, some actions are limited, such as mutex, memory allocation (except for atomic type). Those operations could be done in bottom half.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.