In: Computer Science
Assignment 5
Process Scheduling Queues
The OS maintains all PCBs in Process Scheduling Queues. The OS maintains a separate queue for each of the process states and PCBs of all processes in the same execution state are placed in the same queue. When the state of a process is changed, its PCB is unlinked from its current queue and moved to its new state queue.
The Operating System maintains the following important process scheduling queues −
Job queue − This queue keeps all the processes in the system.
Ready queue − This queue keeps a set of all processes residing in main memory, ready and waiting to execute. A new process is always put in this queue.
Device queues − The processes which are blocked due to unavailability of an I/O device constitute this queue.
1.Long-term Scheduling
a-Long term scheduling is performed when a new process is
created.
b-If the number of ready processes in the ready queue becomes very high, then there is a overhead on the operating system (i.e., processor) for maintaining long lists, context switching and dispatching increases. Therefore, allow only limited number of processes in to the ready queue. The "long-term scheduler" managers this.
c-Long-term scheduler determines which programs are admitted into the system for processing
d-The long-term scheduler limits the number of processes to allow for processing by taking the decision to add one or more new jobs, based on FCFS (First-Come, first-serve) basis or priority or execution time or Input/Output requirements.
d-Long-term scheduler executes relatively infrequently.
Medium-term Scheduling
a-Medium-term scheduling is a part of the swapping function.
b- This scheduler works in close conjunction with the long-term scheduler.
c-It will perform the swapping-in function among the swapped-out processes.
d-Medium-term scheduler executes some what more frequently.
Short-term Scheduling
a-Short-term scheduler is also called as dispatcher.
b-Short-term scheduler is invoked whenever an event occurs, that may lead to the interruption of the current running process.
c-For example clock interrupts, I/O interrupts, operating system calls, signals, etc.
d-Short-term scheduler executes most frequently. It selects from among the processes that are ready to execute and allocates the CPU to one of them.
e-It must select a new process for the CPU frequently. It must be very fast.
Types of CPU scheduling Algorithm
There are mainly six types of process scheduling algorithms
First Come First Serve
First Come First Serve is the full form of FCFS. It is the easiest and most simple CPU scheduling algorithm. In this type of algorithm, the process which requests the CPU gets the CPU allocation first. This scheduling method can be managed with a FIFO queue.
Priority Based Scheduling
Priority scheduling is a method of scheduling processes based on priority. In this method, the scheduler selects the tasks to work as per the priority.
Round-Robin Scheduling
Round robin is the oldest, simplest scheduling algorithm. The name of this algorithm comes from the round-robin principle, where each person gets an equal share of something in turn.
Shortest Job First
SJF is a full form of (Shortest job first) is a scheduling algorithm in which the process with the shortest execution time should be selected for execution next
2 methods to assign processes to processors in multiprocessing
Master/slave multiprocessor system
In a master/slave multiprocessor system, the master CPU is in control of the computer and the slave CPU(s) performs assigned tasks. The CPUs can be completely different in terms of speed and architecture. Some (or all) of the CPUs can have share common bus, each can also have a private bus (for private resources), or they may be isolated except for a common communications pathway. Likewise, the CPUs can share common RAM and/or have private RAM that the other processor(s) cannot access. The roles of master and slave can change from one CPU to another.
Processor coupling
Tightly coupled multiprocessor system
Tightly coupled multiprocessor systems contain multiple CPUs that are connected at the bus level. These CPUs may have access to a central shared memory (SMP or UMA), or may participate in a memory hierarchy with both local and shared memory
Processor coupling
Tightly coupled multiprocessor system
Tightly coupled multiprocessor systems contain multiple CPUs that are connected at the bus level. These CPUs may have access to a central shared memory (SMP or UMA), or may participate in a memory hierarchy with both local and shared memory
In computers, parallel processing is the processing of program instructions by dividing them among multiple processors with the objective of running a program in less time. In the earliest computers, only one program ran at a time.
Multiprocessing is the use of two or more central processing units (CPUs) within a single computer system. The term also refers to the ability of a system to support more than one processor and/or the ability to allocate tasks between them.