Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Overview Assignment 10: hints  Deadlocks & Scheduling Assignment 9: solution  Scheduling.

Similar presentations


Presentation on theme: "1 Overview Assignment 10: hints  Deadlocks & Scheduling Assignment 9: solution  Scheduling."— Presentation transcript:

1 1 Overview Assignment 10: hints  Deadlocks & Scheduling Assignment 9: solution  Scheduling

2 2 A10 Ex1 – Deadlocks Give a real-life example of deadlock. Is it possible to have a deadlock with one process/thread only? Hint: think of types of locks

3 3 A10 Ex2 – Synchronization Primitives Assumption: OS with only a yield() system call Your task: give a pseudo-code implementation of lock, unlock, wait, and notify Hint: keep track of the threads and their state

4 4 A10 Ex3 – Scheduling Implement a scheduler simulator  Input: comma separated list of [time, priority]  Output: average turnaround and response time for First come first served Shortest job first Longest response ratio Highest priority first Round Robin (Hood)

5 5 Overview Assignment 10: hints  Deadlocks & Scheduling Assignment 9: solution  Scheduling

6 6 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 JobTimePriorityRRPrioFCFSSJF A10330241030 B652361612 C22826182 D411730226 E8428143020 Avg.21.22019.214

7 7 A9 Ex2 - Multithreading Difference between kernel threads and user-space threads User level threads:  Managed by an application (customizable)  No preemption, cooperative  Only one CPU Kernel threads:  Managed by kernel  User-space  Kernel-space  more expensive

8 8 A9 Ex3 - Processes Process: has its own address space Thread: shares the address space with some other thread/s Context switch: Threads: save PC, SP, FP, regs Processes: save PC, SP, FP, regs, PT Coroutines: save PC, SP, FP


Download ppt "1 Overview Assignment 10: hints  Deadlocks & Scheduling Assignment 9: solution  Scheduling."

Similar presentations


Ads by Google