Saturday, May 16, 2020

Operating Systems Question Bank with Answers 19

What are the differences between a trap and an interrupt? What is the use of each function?


Question:
What are the differences between a trap and an interrupt? What is the use of each function?

Answer:
A trap is an exception that is reported immediately following the execution of the trapping instruction. It is a software-generated interrupt and is triggered by a user program to invoke operating system functionality.
An interrupt is a hardware-generated signal that changes the flow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction.
An interrupt can be used to signal the completion of I/O so that the CPU doesn't have to spend cycles polling the device. A trap can be used to catch arithmetic errors or to call system routines.


******************
Related Questions:


  • What are the differences between a trap and an interrupt? What is the use of each function?

No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery