When a teacher is in a class, his/her lecture can be disrupted by either of the following two events:

  1. Somebody from outside the class interrupts the lecture by knocking on the door. This event is an asynchronous event because the teacher has nothing to do with this disruption. At his/her convenience, the teacher suspends his/her lecture and listens to what the visitor has to say.

    This is a situation similar to a device interrupting the CPU for seeking a particular service. The CPU suspends the execution of the current program, saves its context, and jumps to an interrupt service routine.

    There is no specific time for the interrupt to occur. The CPU need not handle the interrupt immediately but only when ...

Get Object-Oriented Programming with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.