Introduction to CPU Scheduling

CPU scheduling is very necessary in the case of multiprocessor systems.  when there are multiple processes to execute, the processor cannot wait until the process is complete.  it needs to switch between the processes simultaneously so that the response time of your computer will be high.

CPU should not be kept idle. It should execute one of the processes in the queue,  in order to decrease the waiting time and increase the user experience.

Single Processor vs Multi Processor System

Single processor system

  1. Most systems use single processor systems.
  2. They perform only one process at a given time, and it carries out the next process in the queue only after the current process is completed.
  3. OS monitors the status of them and also sends them next executable instruction.
  4. It relieves CPU of disk scheduling and other tasks.
  5. It is suitable for general purpose computers , as it cannot run multiple processes in parallel.

Multi Processor System

  1. Also known as parallel or tightly coupled systems as they can run multiple process in parallel to each other efficiently.
  2. Two or more processors will be in close communication with each other with shared memory, storage and power supply.
In these days rather than using multi processor systems, people tend to buy single processor with multiple cores. This can be more efficient as internal on-chip communication is faster than communication between different processors.
Multi-core processors also use less power than that of multiple single core processors.

Advantages

Increased throughput

As there are a number of processors, more work can be done in less time. These multiple processors run parallel to each other increasing the performance of the system.

Reliability and failure-free

Failure of any processor will not affect the functionality of the system, as there are a number of processors. We can expect failure free service from multi-processor system.

Economy of scale

Multi Processor Systems cost less than a number of individual single processor system. In the case of multi processor system expenditure for system cabinet, memory power supply, accessories are saved as these systems share resources like power supply, memory and also space.








Operating System - User View and System View

Operating System is designed both by taking user view and system view into consideration.
Below is what the users and system thinks about Operating System.

User View

  1. The goal of the Operating System is to maximize the work and minimize the effort of the user.
  2. Most of the systems are designed to be operated by single user, however in some systems multiple users can share resources, memory. In these cases Operating System is designed to handle available resources among multiple users and CPU efficiently.
  3. Operating System must be designed by taking both usability and efficient resource utilization into view.
  4. In embedded systems(Automated systems) user view is not present.
  5. Operating System gives an effect to the user as if the processor is dealing only with the current task, but in background processor is dealing with several processes.

System View

  1. From the system point of view Operating System is a program involved with the hardware.
  2. Operating System is allocator, which allocate memory, resources among various processes.It controls the sharing of resources among programs.
  3. It prevents improper usage, error and handle deadlock conditions.
  4. It is a program that runs all the time in the system in the form of Kernel.
  5. It controls application programs that are not part of Kernel.

What is Operating System

Operating System is an interface between the user and the system, by allocated various hardware resources such as memory among various Software and processes.
In addition it also provides GUI interface for users to easily operate upon the system and hardware. It performs job scheduling, system maintenance, which we will discuss in later posts

A Computer system can be roughly divided into 4 parts - Hardware, Operating System, System Software and Application software.
Below the diagram shows the basic interaction of Operating System with hardware and other Software.

Operating System Basic


In the above figure you can notice that Operating System acts as a link between hardware and software. User interacts on Software and thus operated upon hardware indirectly through Operating System.

Back To Top