1 Christmas special - Overview Assignment 9: hints  Scheduling Assignment 8: solution  Deadlocks.

Slides:



Advertisements
Similar presentations
Overview Assignment 8: hints Assignment 7: solution Deadlocks
Advertisements

473 Quiz. Assuming 4kB to save information about one function call, what is the largest integer whose factorial can be calculated by a recursive program.
Previously… Processes –Process States –Context Switching –Process Queues Threads –Thread Mappings Scheduling –FCFS –SJF –Priority scheduling –Round Robin.
1 Overview Assignment 10: hints  Deadlocks & Scheduling Assignment 9: solution  Scheduling.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Processes and Their Scheduling.
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Chapter 2: Processes Topics –Processes –Threads –Process Scheduling –Inter Process Communication (IPC) Reference: Operating Systems Design and Implementation.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Scheduling in Batch Systems
Avishai Wool lecture Priority Scheduling Idea: Jobs are assigned priorities. Always, the job with the highest priority runs. Note: All scheduling.
Review: Process Communication Sequential Communication –Result of P1 becomes at termination the input to P2 –Tools: Redirect (>,>>) and Pipe (|) Concurrent.
5.6.2 Thread Synchronization with Semaphores Semaphores can be used to notify other threads that events have occurred –Producer-consumer relationship Producer.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
Multithreading.
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.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
COP 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Chapter 6: CPU Scheduling
Processes and Threads.
1 Process States (1) Possible process states –running –blocked –ready Transitions between states shown.
Chapter 4 Processor Management
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Scheduling Strategies Operating Systems Spring 2004 Class #10.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Processes, Threads, Race Conditions & Deadlocks Operating Systems Review.
CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Operating Systems Examples Algorithm.
Cpr E 308 Spring 2004 Real-time Scheduling Provide time guarantees Upper bound on response times –Programmer’s job! –Every level of the system Soft versus.
CPU Scheduling Basic Concepts. Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
2.5 Scheduling Given a multiprogramming system. Given a multiprogramming system. Many times when more than 1 process is waiting for the CPU (in the ready.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
CS140 Project 1: Threads Slides by Kiyoshi Shikuma.
OBJECTIVE: To learn about the various system calls. To perform the various CPU scheduling algorithms. To understand the concept of memory management schemes.
2.5 Scheduling. Given a multiprogramming system, there are many times when more than 1 process is waiting for the CPU (in the ready queue). Given a multiprogramming.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Consider the Java code snippet below. Is it a legal use of Java synchronization? What happens if two threads A and B call get() on an object supporting.
CS333 Intro to Operating Systems Jonathan Walpole.
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
1 Chapter 5: CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Processes and Threads Processes and their scheduling
Section 10: Last section! Final review.
Chapter 5: CPU Scheduling
Process management Information maintained by OS for process management
MODERN OPERATING SYSTEMS Third Edition ANDREW S
ICS 143 Principles of Operating Systems
CPU Scheduling Basic Concepts Scheduling Criteria
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
CS1550: Quiz #1 Quiz #1.
COP 4600 Operating Systems Spring 2011
Multithreading.
COT 4600 Operating Systems Spring 2011
First slide Rest of project 2 due next Friday Today:
February 5, 2004 Adrienne Noble
Scheduling 21 May 2019.
CSE 153 Design of Operating Systems Winter 2019
EECE.4810/EECE.5730 Operating Systems
Presentation transcript:

1 Christmas special - Overview Assignment 9: hints  Scheduling Assignment 8: solution  Deadlocks

2 A9 Ex1 - Scheduling 5 jobs arrive at the same time Process turnaround time: the time elapsed from the submission of the job until the job was done JobTimePriority A103 B65 C22 D41 E84

3 A9 Ex1 - Scheduling Compute the average process turnaround time for:  Round robin  Priority scheduling  First-come, first-served (arrival: A, B, C, D, E)  Shortest job first

4 A9 Ex2 - Multithreading Some kernels allow for only one execution thread Multiple threads implemented in user- space Describe the difference between kernel threads and user-space threads (hints: system-call cost, access to kernel structures).

5 A9 Ex3 - Processes What are the differences between threads and processes? Compare the data to be saved during a context switch for:  Coroutines (Oberon)  Threads  Processes

6 c.send(msg) c.receive(msg) Process AProcess B channel c synchronization PEx1 – CSPs

7 PEx1 - Erathostenes’ Sieve Number Generator Filter Filter Filter Filter 7 The numbers dividable with the filter number are dropped The other numbers are passed to the next filter If no filter exists, create one

8 PEx2 - How big should a TLB be? A TLB miss requires 20 instructions iTLB configurations  128 entries, two-way assoc, 4-64 KB pages  512 entries, two-way assoc, 4-64 KB pages Use SimpleScalar simulator and one or more SPEC2000 benchmarks to calculate  Instruction TLB miss rate  Instruction TLB overhead: percentage of time wasted handling TLB misses

9 PEx2 - How big should a TLB be? Download SimpleScalar and the SPEC2000 binaries Type./sim-cache –h Default = 16 sets, 4 KB pages, four-way assoc, LRU replacement A new configuration for data TLB is set by./sim-cache –tlb:dtlb dtlb:128:8192:4:r

10 Christmas special - Overview Assignment 9: hints  Scheduling Assignment 8: solution  Deadlocks

11 A8 Ex1 - Barrier (Java) public class Barrier { private static int N; private static int count; public Barrier(int n) { N = n; count = 0; } public void synchronized enter() { if (count++ == N) { notifyAll(); count = 0; } else { wait(); }

12 A8 Ex1 - Barrier (Active Oberon) MODULE Barriers; TYPE Barrier = OBJECT VAR n, N: LONGINT; PROCEDURE Enter*; VAR i: LONGINT; BEGIN {EXCLUSIVE} i := n DIV N; INC(n); AWAIT (i < n DIV N) END Enter; PROCEDURE & Init (nofProcs: LONGINT); BEGIN N := nofProcs; n := 0 END Init; END Barrier; END Barriers.

13 A8 Ex2 - Deadlock Avoidance Ordering  the resources are ordered  a lock manager assigns lock using priorities (e.g. the account with the lower number gets the lock first). Two-phase locking

14 A8 Ex1 - Baboons Semaphore  starvation is possible Ticketing system  tickets are released when a process (baboon) request access to the resource (rope)  access is granted to process with tickets (in increasing order)

15 Merry Christmas!