Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Applied Network and Operating Systems (E2005) Individual Synopsis Submitted by Viji P.Praveen(170181-2995) SCHEDULING Operating system: Operating system is a software which is essential for the user to interact with the computer systems. It is used to manage the software and hardware resources of the computer efficiently and coordinate the use of system components. Process: Process is defined as program in execution. It is used to access resources like the processor, memory data ,files etc.. and also used for communication and scheduling. The possible process states? Running - process is running on CPU. Ready - ready to run, but not actually running on the CPU. Waiting - waiting for some event like IO to happen Need for scheduling: Scheduling is a one which Determines which processes run when there are multiple runnable processes. This scheduling has a big effect on resource utilization and the overall performance of the system as it is responsible for allocation of the process to the CPU so that the system efficiency is increased. Scheduling criteria: The following criteria has to be taken into consideration for choosing the proper scheduling method. CPU Utilization: Keep CPU utilization as high as possible. Throughput: number of processes completed per unit time. Turnaround Time: mean time from submission to completion of process. Waiting Time: Amount of time spent ready to run but not running. Response Time: Time between submission of requests and first response to the request. Scheduling strategies: These are some of the strategies used for scheduling. 1. 2. 3. 4. 5. 6. First-Come, First-Served scheduling Shortest-Job-First scheduling Priority scheduling Deadline scheduling Round-Robin Scheduling Multilevel Scheduling First-Come, First-Served scheduling OS runs the process at head of queue, new processes come in at the end of the queue. A process does not give up CPU until it either terminates or performs IO. The turnaround and waiting times depend strongly on previous jobs .The disadvantage in this system is short jobs may be treated poorly. Many short I/O-bound jobs may stuck behind one long processor-bound job .This scheduling is better for processor-bound jobs than for I/O-bound jobs Shortest-Job-First scheduling: This scheduling can eliminate some of the variance in Waiting and Turnaround time. In fact, it is optimal with respect to average waiting time. This has one ready queue and the new job to the end of the queue. The next job is based on the estimated service time and takes the first job with lowest time estimate. Jobs run to completion with no preemption. The disadvantage is its very difficult to estimate the exact service time for the process Priority scheduling: Each process is given a priority, then CPU executes process with highest priority. If multiple processes with same priority are runnable, then use some other criteria. Shortest job first scheduling is an example of a priority-based scheduling algorithm. The disadvantage is low priority processes may be starved by steady stream of high priority processes Round-Robin Scheduling Round robin is a clock based preemption where every process is given a time slice and the process run automatically when its given the time slice and the jobs are placed in a circular queue. So all the jobs get its turn in a periodic manner. The concern is shorter jobs are treated well over the longer jobs. This one is better for processor-bound jobs than for I/O-bound jobs Multilevel Scheduling Multilevel scheduling is same like Round Robin, except have multiple queues. Typically, classify processes into separate categories and give a queue to each category. So, might have system, interactive and batch processes, with the priorities in that order. Could also allocate a percentage of the CPU to each queue Non-preemptive system : Here the process runs until the process is finished or its blocked or it makes a system request Preemptive system : In Preemptive system the process runs until interrupt new process arrives or a blocked process becomes ready or current process time slice ends .The concern is its not sure that the process complete its work safely. Most modern Operating systems use preemptive type of scheduling. Deadlocks: A set of process is deadlocked if each process in the state is waiting for an event that only other process in the set can cause. Conditions for Deadlock: 1. Mutual exclusion condition where each resource is assigned to one process or it is available 2. Hold and wait condition – either it has to force a process to request all process at a time or it must release all resources it holds and then reacquire all it needs 3. No preemption condition where previously granted resources cannot be forcibly taken away 4. Circular wait condition –here it must be a circular chain of more processes and each is waiting for resource held by next member of the chain. Preventing Deadlock: To prevent deadlock at least one of the conditions of deadlock should be false at all times and mutual exclusion must hold at all times.