Why would the OS suspend a process? To eliminate thrashing for memory frames What parts of the process state need to be collected? All of the process?s data (address space) + the state of all threads created by the process (TCBs) + the state of I/O (file handles, communication endpoints, etc.) Explain the priority-inversion problem (will not be graded. Syllabus should say Chp 6 excluding 6.9, not 6.8) (not graded) A high-priority process has to wait for a low-priority one. Ex. a high-priority process is blocked waiting for a low-priority process to release a resource Implement producer/consumer problem using semaphores Semaphore full = 0; // # of filled slots Semaphore empty = N; // # of empty slots Semaphore mutex = 1; //mutual exclusion Producer( ) { Consumer( ) { P(empty); P(full); P(mutex); P(mutex); //fill a slot //empty a slot V(mutex); V(mutex); V(full); V(empty); } } Describe a deadlock situation in the dining philosophers problem Each philosopher grabs the chopstick to their right Describe how the necessary conditions for deadlock hold in this scenario Mutual exclusion ( only one philosopher can use each chopstick at a time Hold and wait ( after grabbing a chopstick, a philosopher holds it while waiting for the next chopstick No preemption ( a philosopher can?t take a chopstick away from another Circular wait ( each philosopher waits for the next around the table Describe how to break one of these conditions HAW can be broken by releasing a previously acquired chopstick if the other chopstick is not available Assume that in a system with a 32-bit address space, the page size is 8 Kbytes, the physical memory size is 1 GByte, and each entry of the page table requires 4 bytes. What is the minimum size of physical memory that needs to be allocated for a single-level page table? Answer the same question for a two-level page table and an inverted page table as well. linear page table = 2 Mbytes inverted page table = 512 Kbytes two-level page table = 6 Kbytes, assuming a first level PT with 512 entries and each second-level PT with 1 K entries. Mention two advantages of small page sizes Reduce risk of internal fragmentation Enable shorter disk transfers Mention two advantages of larger page sizes Reduce the size of the page table Increase the sequentiality of disk accesses
STUDYBLUE makes things that make you better at school.
Things like
online flashcards with photos and audio.
Things like personalized quizzes and friendly reminders about when (and what) to study next.
Think of it as a digital backpack™: access to all of your study materials online and on your phone.
STUDYBLUE exists to make studying efficient and effective for every student, for free.
Join us.
“I have been getting MUCH better grades on all my tests for school. Flash cards, notes, and quizzes are great on here. Thanks!”
Kathy