CY2003 Computer Systems Lecture 11 Review Lecture.

Slides:



Advertisements
Similar presentations
Operating Systems: Monitors 1 Monitors (C.A.R. Hoare) higher level construct than semaphores a package of grouped procedures, variables and data i.e. object.
Advertisements

Part IV: Memory Management
Operating Systems Review.
CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
Fundamentals of Python: From First Programs Through Data Structures
CY2003 Computer Systems Lecture 05 Semaphores - Theory.
Operating Systems Chapter 6
Scheduling Algorithms
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
What we will cover…  CPU Scheduling  Basic Concepts  Scheduling Criteria  Scheduling Algorithms  Evaluations 1-1 Lecture 4.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
Operating Systems (CSCI2413) Lecture 3 Processes phones off (please)
02/11/2004CSCI 315 Operating Systems Design1 CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying.
Operating Systems Review. Questions What are two functions of an OS? What “layer” is above the OS? What “layer” is below the OS?
1 Sleeping Barber Problem There is one barber, and n chairs for waiting customers If there are no customers, then the barber sits in his chair and sleeps.
18/02/08Week 21 CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
5.4 Which of the following scheduling algorithms could result in starvation? a. First-come, first-served b. Shortest job first c. Round robin d. Priority.
Exam Review Operating Systems CS 550. Items of Interest Exam is Nov. 19, 2014 Focus on material since last exam, though knowledge of initial material.
Chapter 4 Processor Management
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
(a) Alice and Bob are back together. Today Alice wants to send Bob a message that is secret and also authenticated, so that Bob "knows" the message came.
CHP-4 QUEUE.
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Classical problems.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
Thread Synchronization Tutorial #8 CPSC 261. A thread is a virtual processor Each thread is provided the illusion that it owns a core – Copy of the registers.
Homework Assignment #2 J. H. Wang Oct. 17, 2007.
Consider the program fragment below left. Assume that the program containing this fragment executes t1() and t2() on separate threads running on separate.
ECE291 Computer Engineering II Lecture 15 Dr. Zbigniew Kalbarczyk University of Illinois at Urbana- Champaign.
OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
CSE 451 Section Thursday, October 30. Questions from Lecture?
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
B. B. Karki, LSU 0.1 CSC 4103: Operating Systems CSC 4103: Operating Systems Spring 2013 Bijaya B Karki and Coretta Douglas Wednesday 5:00 PM to 7:50 PM.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
CHP-4 QUEUE Cont…. 7.DEQUE Deque (short form of double-ended queue) is a linear list in which elements can be inserted or deleted at either end but not.
Operating System Concepts and Techniques Lecture 13 Interprocess communication-2 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and.
CE Operating Systems Lecture 8 Process Scheduling continued and an introduction to process synchronisation.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Tutorial 3: Homework 2 and Project 2
MIDTERM REVIEW CSCC69 Winter 2016 Kanwar Gill. What is an OS? What are processes and threads? Process states? Diagram showing the state changes What data.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Processes and threads.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
CPU SCHEDULING.
Chapter 2 Memory and process management
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Synchronization, part 3 Monitors, classical sync. problems
CS 425 / ECE 428 Distributed Systems Fall 2016 Nov 10, 2016
Section 10: Last section! Final review.
CS 425 / ECE 428 Distributed Systems Fall 2017 Nov 16, 2017
Chapter 2 Scheduling.
CPU Scheduling.
Process management Information maintained by OS for process management
Operating Systems Review.
Chapter 6: CPU Scheduling
Operating System Concepts
Synchronization, part 3 Monitors, classical sync. problems
Critical section problem
Process Scheduling Decide which process should run and for how long
Barbershop Example We can simulate a barbershop using semaphores.
CSE 451: Operating Systems Winter 2003 Lecture 6 Scheduling
February 5, 2004 Adrienne Noble
Processor Scheduling Hank Levy 1.
CPU SCHEDULING CPU SCHEDULING.
CSCS-200 Data Structure and Algorithms
Synchronization, part 3 Monitors, classical sync. problems
CSE 451: Operating Systems Winter 2001 Lecture 6 Scheduling
Presentation transcript:

CY2003 Computer Systems Lecture 11 Review Lecture

© LJMU, 2004CY20032 Overview

Exam

© LJMU, 2004CY20034 Processes Four processes arrive at the same time in the order A B C D. A and D have priority 10 and B and C have priority 20; the highest priority is 0. A requires 10 ticks, B requires 15 ticks, C and D both require 20 ticks; the CPU quantum before a process is pre- empted is 5 ticks. The system uses Priority Queue scheduling. Ignoring any overhead for context switching between processes, calculate BOTH the average Waiting Time and average TurnAround Time. Explain why a priority-based mechanism is desirable for scheduling and why the priority of processes needs to be dynamically adjusted.

© LJMU, 2004CY20035 Semaphores A barbershop is designed so that there is a private room that contains the barber chair and an adjoining waiting room with a sliding door that contains N chairs. If the barber is busy, the door to the private room is closed and arriving customers sit in one of the occupied chairs. If a customer enters the shop and all chairs are occupied, the customer waits until a chair is available to sit in. If there are no customers to be served, the barber goes to sleep in the barber chair with the door to the waiting room open. If the barber is asleep, the customer wakes the barber and obtains a haircut. Use semaphores to write code fragments for barber and customer process that implement this synchronisation scheme. Explain your solution. This is a Producer/Consumer situation where the barber represents the Consumer.

© LJMU, 2004CY20036 Semaphores –shared int emptychairs = N –shared semaphore mutex = 1 –shared semaphore waitingCustomer = 0 –shared semaphore availChair = N Customerbarber while true { down (availChair); down(mutex); emptyChairs--; up (mutex); up (waitingCustomer); } while true { down (waitingCustomer); down (mutex); emptyChairs++; up (mutex); up (availChair); }

© LJMU, 2004CY20037 Semaphores Two types of process, A and B, must always run in the following order A B A B A B A B A B.... i..e. one instances of process type A followed by exactly one instance of process B. Produce a solution, based on semaphores, to the above problem.

© LJMU, 2004CY20038 Memory Management In a system with virtual memory, pages may either be resident in memory or in the swap area on disk. Identify what information needs to be maintained for the Page Table entry in each page. First In First Out (FIFO) is one possible algorithm for deciding what page to swap at any point. Compare and contrast any TWO OTHER algorithms which might be used.

© LJMU, 2004CY20039 File management An operating system supplies system calls to allow you to COPY, DELETE and RENAME a file. Discuss the differences between using COPY/DELETE RENAME To give a file a new name

© LJMU, 2004CY Petri net Study the following properties on the markings graph and explain how you deduce them: –Conservativeness –Liveness –Safeness –Boundedness (k)