Two parts execute a fixed of p instrs driver do normal

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: to given device class P : privileged instruction (exception if mode not supervisor) Project Project #1 I instruction: yes, it is kludgey…. Two parts: “execute” a fixed # of P instrs ( ~ driver) do normal kernel bookkeeping Project Project #1 RR scheduling (fixed Q, ignore priorities) Lottery scheduling (priority ~ tickets) Don’t have to implement currencies , ticket exchange, inflation, inflation, unless you want to Project Project #1 Top: a separate Unix process that probes your OS tables to print system system state decide how top will get information from the kernel. Project Project #1: Suggestions Modular design C/C++ Synchronous, then asynchronous Make Make sure one of your team has strong C/C++ skills and Unix system programming esp. signals/timers, IPC Deadlock Deadlock vs. Starvation Starvation – there is a situation (maybe pathological) that an entity will have to wait for a resource for a long time, BUT eventually they get it Examples? Deadlock is different Deadlock Deadlock Deadlock is closely related to starvation. • Processes wait forever for each other to wake up and/or release resources. • Example: dinning philosophers . The difference between deadlock and starvation is subtle. • With starvation, there always exists a schedule that feeds the starving starving party. The situation may resolve itself…if you’re lucky. • Once deadlock occurs, it cannot be resolved by any possible future schedule. …though there may exist schedules that avoid deadlock. Dining Dining Philosophers • N processes share N resources • resource requests occur in pairs • random think times • hungry philosopher grabs a fork • ...and doesn’t let go • ...until the other fork is free • ...and the linguine is eaten will deadlock always occur? 4 A B D 3 1 C 2 while(true) { Think(); AcquireForks(); Eat(); ReleaseForks(); } Four Four Preconditions for Deadlock Four conditions must be present for deadlock to occur: 1. Non-preemptability. Resource ownership (e.g., by threads) is non-preemptable. Resources are never taken away from the holder. 2. 2. Exclusion. Some thread cannot acqu...
View Full Document

This document was uploaded on 04/02/2014.

Ask a homework question - tutors are online