View Single Post
  #9   Spotlight this post!  
Unread 23-03-2016, 17:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,028
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Manually cancelling a Command

Quote:
Originally Posted by axiomofdarkness View Post
What would an interrupt be then?
The hardware generates an electrical signal (called an interrupt) that causes the CPU to stop what it's doing, save its "context", jump to a new location in program memory, and start executing there. That location is called an ISR -- interrupt service routine. When the ISR is done executing, it tells the CPU to go back to where it was when the interrupt occurred. The CPU uses the saved "context" to go back to where it was, as it was.

You can see there is no polling involved. That's the advantage of interrupts.

The disadvantage is that interrupts can occur at any time -- asynchronously -- so you have to be careful when using them.