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

Local-Area Networks

Local-Area Networks ( LANs ) are restricted to a small area. Such Networks may be established within a building. Computers that are part of Local-Area Networks are Personal Computers ( PCs ) or microcomputers. These Computers are connected to each other. Simple communication lines connect these Pers Networks bring people together. When people join  hands teamwork becomes possible. The structural composition of LANs simplifies teamwork. In other words, LAN hardware supports teams having similar processing requirements. LAN Computers readily support personalization of tasks allocated to professionals.  Office staff can work together and share information. This improves the efficiency of the entire workforce. It has been noted that here all the Networked Computers are Personal Computers. They are of equal capacity. Mostly LAN users have similar tasks. If situations allow, a user is independent to access any Computer to serve his purpose. LAN users can exercise the option of secu...

Computers - An Introduction

Computers are man made machines. They are made to work very fast. Working fast they can solve  big and small problems.  Modern science has given us these computers. They are very popular. Computers affect and change lives. They keep us happy.The happiness grows. Computers are quick and smart. Great problem solvers and simplifiers are our computers. They can do our work without stopping. Focus is on doing only what is needed. Not needed, not done.  Computers are  life-less servants. They cannot think or make decisions on their own. They are empowered to work. They are given each and every thing so that they carry out our orders. Orders are respected by computers. The manner in which computers work is wholly dependent on man.  The quality of service provided by computers is remarkable. They are loved by human beings. Computers are known for smart and quick service. Computers do not give wrong results. Correct answers are always given. Questions which are difficult...

Euclid's Algorithm

The Greatest Common Divisor ( GCD ) of  two numbers is a number. The number ( GCD ) causes division of the two numbers. This number ( GCD ) is the greatest number that is possible. This divisor partially forms the two numbers. Adding  the divisor successively may result in formation of the two numbers. One can note that when the divisor is the greatest, the division of the dividend is the sharpest. The division operation is very effective. When the Greatest Common Divisor of two numbers is considered, we think of a number that can cause division of both the numbers. Here the two numbers are unequal. The Greatest Common Divisor causes divisions of the two numbers differently. This is clear from the two different quotient values.  The GCD value is very interesting to note. It relates very well with the two numbers. The GCD of two even numbers is also an even number. The GCD of two odd numbers is an odd number. So, we can say that GCD is an abstraction of the two numbers in ...