Skip to main content

Events and Handlers

Computer Programs are processed by the CPU to give results. A Computer Program that is being processed may be suspended. The suspension of the Computer Program is controlled by the Computer. 

The suspension of processing activity related to a Computer Program is reasonable. Yes, the Computer was busy with processing activity. But something more important has to be attended. This activity that is more important may originate from Computer Software or Computer Hardware. 

Let us talk in a more focused way. Yes, a Computer Program is being processed. The CPU of the Computer is busy with the said processing of the Computer Program. At the same time an attempt may be made to attract the attention of the CPU. 

We say that an Event has occurred while processing of a Computer Program is going on. This Event tries to catch the attention of the CPU.

An Event is an activity that has special importance. As told earlier the Event may come from a Hardware Unit, or a piece of Software. The Event that has occurred requires processing. Yes, processing of the Event by the CPU is the treatment for the occurred Event.

The processing of an Event by the CPU is called Event Handling. Event Handling is performed by Event Handler. 

_________________________

Real Life Event Handler 

_________________________

Let us suppose that one is watching a YouTube video. While one is in the middle of viewing, suddenly somebody rings the doorbell. This ringing of the doorbell can be treated as an Event. 

As we said, an Event has to be handled immediately after occurrence. Yes, the doorbell requires immediate response ( handling ). 

Now, the YouTube video is paused. The viewer attends the doorbell. 

Attending  the doorbell may require us to perform a set of activities. Finally, the doorbell issue is settled. We can say, the doorbell call is attended.

The set of activities that were performed are notable. These notable activities related to serving the purpose of the doorbell ring form the 'Doorbell Ring Handler'. 'Doorbell Ring Handler' can be likened to an  Event Handler.

A return is required to the YouTube video. It was our parent activity that related to viewing the video content.  The viewing activity was suspended to attend the doorbell call. The suspension does not stand. 

We happily focus  to view the YouTube video from the point where we had left. The viewing activity continues. Let us suppose there is no interruption onwards. So, we are able to watch the full video presentation.

This resumption of viewing can be likened to resumption of the Computer Program. The Computer Program was suspended at the occurrence of the Event. 

The Computer Program is started from a point which lies next to the program instruction that the Computer was processing. During this processing activity the occurrence of the Event was observed. The instruction that was being executed at the time of the occurrence of the Event is finalized. 

The processing activity of the rest of the Computer Program continues 

Comments

Popular posts from this blog

Interface Message Processor ( IMP )

Interface Message Processor ( IMP ) is a special purpose Computer. The Processor plays a vital role in Host-to-Host communication. IMP is placed between Host Computers.  IMP helps Hosts to exchange information. IMPs ( Interface Message Processors ) form a group. The group dedicates itself towards reliable transmission of Packets. _________________________ Note: An Interface Message Processor can be supposed to have a face. Firstly this supposed face of IMP is in the direction of the first Host, which sends the  message. Secondly, this face is turned towards the other Host.  Now, the IMP,  with its face turned around, communicates with this other Host.  Transformed message from IMP is communicated to this Host. __________________________ Message ( a piece of information ) sent from the Host ( source of information  ) is transformed into Packets. Transformation of the message into Packets is performed by an IMP. These Packets are forwarded to the receiver H...

Understanding Distribution

Distributed presence means that more than one object is there. Also, these objects are situated at more than one location.  One object may establish communication with another object. The first object may deliver some message. The message can be received by another object. It can be said that object distribution is successful, as one object has succeeded in delivering a message. The second object has successfully received the message. Two objects are at a distance. Communication brings them closer. The successful communication has served to highlight that the idea of distribution is meaningful. Distribution helps exchange of information. Many different objects can form a group.  Two groups can occupy different locations.  It may happen that at a particular location there are several objects. But, all these objects talk among themselves.They talk among themselves and make things happen.  There is a resultant of this talk process. All the communicating objects  at...

Message Switching

Message is a piece of information. Switching means movement.  In a Network there are a number of nodes. Nodes are vital junctions of a Network. Message Switching means transmission from one node ( one point ) of a Network to another node ( another point ). So, transmission is from point to point. Transmission from one point to another point is a single hop ( jump ). Message Switching means switch over of a Message. In one step of Message Switching,  Message switches over from one node to another.  The two nodes involved in a Switching operation are on the same Network. It cannot be that the beginning node ( source node) is on one Network and the second node ( sink node ) is on a different Network. In a point to point ( one junction to another junction ) transmission, a Message travels a part of its journey. Message moves from previous point to next point. The Network is Point-to-Point Network. A Switching activity means movement of a message. Indeed, the Message has mov...