1 / 8

Overview

Overview. Assignment 10: hints Deadlocks & Scheduling Assignment 9: solution Scheduling. 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. A10 Ex2 – Synchronization Primitives.

isanne
Download Presentation

Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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. 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. 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. Overview • Assignment 10: hints • Deadlocks & Scheduling • Assignment 9: solution • Scheduling

  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

  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. 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

More Related