Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8646211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:44:49+00:00 2026-06-12T12:44:49+00:00

I have some confusion when looking at how interrupt handler(ISR) is run. In Wiki

  • 0

I have some confusion when looking at how interrupt handler(ISR) is run. In Wiki http://en.wikipedia.org/wiki/Context_switch, it describes interrupt handling with 2 steps:

1) context switching

When an interrupt occurs, the hardware automatically switches a part of the 
context (at least enough to allow the handler to return to the interrupted code).
The handler may save additional context, depending on details of the particular
hardware and software designs.

2) running the handler

The kernel does not spawn or schedule a special process to handle interrupts, 
but instead the handler executes in the (often partial) context established at 
the beginning of interrupt handling. Once interrupt servicing is complete, the 
context in effect before the interrupt occurred is restored so that the 
interrupted process can resume execution in its proper state.

Let’s say the interrupt handler is the upper half, is for a kernel space device driver (i assume user space device driver interrupt follow same logic).

when interrupt occurs:

1) current kernel process is suspended. But what is the context situation here? Based on Wiki’s description, kernel does not spawn a new process to run ISR, and the context established at the beginning of interrupt handling, sounds so much like another function call within the interrupted process. so is interrupt handler using the interrupted process‘s stack(context) to run? Or kernel would allocate some other memory space/resource to run it?

2) since here ISR is not a ‘process’ type that can be put to sleep by scheduler. It has to be finished no matter what? Not even limited by any time-slice bound? What if ISR hang, how does the system deal with it?

Sorry if the question is fundamental. I have not delved into the subject long enough.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:44:51+00:00Added an answer on June 12, 2026 at 12:44 pm

    so is interrupt handler using the interrupted process’s stack(context) to run? Or kernel would allocate some other memory space/resource to run it?

    It depends on the CPU and on the kernel. Some CPUs execute ISRs using the current stack. Others automatically switch to a special ISR stack or to a kernel stack. The kernel may switch the stack as well, if needed.

    since here ISR is not a ‘process’ type that can be put to sleep by scheduler. It has to be finished no matter what?

    Yep, or you’re risking to hang your computer. You see, interrupts interrupt processes and threads. In fact, most CPUs have no concept of a thread or a process and to them it doesn’t matter what gets interrupted/preempted (it can even be another ISR!), it’s just not going to execute again until the ISR finishes.

    Not even limited by any time-slice bound? What if ISR hang, how does the system deal with it?

    It hangs, especially if it’s a single-CPU system. It may report an error and then hang/reboot. In fact, in Windows (since Vista?) hung or too slowly executing deferred procedures (DPCs), which aren’t ISRs but are somewhat like them (they execute between ISRs and threads in terms of priority/preemption) can cause a “bugcheck”. The OS monitors execution of DPCs and it can do that concurrently on multiple CPUs.

    Anyway, it’s not a normal situation and typically there’s no way out of it other than a system reset. Look up watchdog timers. They help to discover such bad hangs and perform a reset. Many electronic devices have them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some confusion about when to use the self keyword during ivars assignment,
Hello everyone, I have some confusion regarding some Win32 API data types and macros
I am in process of creating my first app and have some confusion over
I have some old school looking code that is as follows: IList<KeyValuePair<string, ValuePair>> ServicePairs
I am developing a Java Desktop Application but have some confusions in choosing a
I am learning JPA from this tutorial . I have some confusions in understanding
i have some questions about constructors in ColdFusion : must i use the name
I know this sounds confusing: I have just built some basic prev/next pagination for
I have an SQL question which may be basic to some but is confusing
i have a coldfusion cfc and some methods in it. MethodA will return a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.