Computer Science  >  EXAM  >  CECS 326 Midterm 2 Study Guide | Questions with Verified Answers (All)

CECS 326 Midterm 2 Study Guide | Questions with Verified Answers

Document Content and Description Below

CECS 326 Midterm 2 Study Guide | Questions with Verified Answers Which OS's sweep deadlocks under the rug and pretend they don't exist as a method for handling deadlocks? Linux and Windows, ofte ... n leave it up to kernel/app developers to handle it TRUE/FALSE: Disallowing recovery after a deadlock is a method for handling deadlocks. FALSE: allowing the management of recovery is a vital method to handling deadlocks What system allows deadlocks to occur and manages its recovery? Databases What are the two ways to ensure a Deadlock never occurs? Deadlock Prevention and Deadlock Avoidance How can the mutual exclusion condition be altered to prevent deadlocks? TRICK QUESTION: mutual exclusion cannot be prevented and must hold, some resources are fundamentally not shareable How can the hold and wait condition be altered to prevent deadlocks? guarantee a thread doesn’t hold other resources whenever it requests a new resource Can starvation occur when implementing a non-hold and wait condition? yes, low resource utilization will leave threads starved if they require multiple resources How can the no preemption condition be modified to prevent deadlocks? if a process holding some resources and requests another resource that can’t immediately be allocated, the process releases all of its resources it currently holds. process will be restarted its old resources AND the new ones it requested Would the preemption condition for preventing deadlocks be more likely used for resources like CPU registers or semaphores/mutex locks CPU registers, preemption works best with resources can easily save and reload save states. its not ideal for semaphores/mutex locks where deadlocks occur most commonly How could the circular wait condition be altered to prevent deadlocks? impose a total ordering of resource types, and require that each process requests resources in an increasingly enumerated order Which deadlock prevention method is overall the most practical? No circular wait method TRUE/FALSE: the no circular wait method's hierarchy intrinsically prevents deadlocks. BONUS: how do java developers order lock acquisition? FALSE: it is up to developers to USE the hierarchy to prevent deadlocks BONUS: System.identityHashCode(Object) The most prominent model for deadlock avoidance requires what additional info about each thread? maximum number of resources of each type it needs TRUE/FALSE: A safe state is when a system can allocate resources to each thread up to its max in some order and still avoid a deadlock TRUE Which deadlock avoidance algorithm is used for single instances of a resource type, and which for multiple? SINGLE: resource allocation graph MULTIPLE: Banker's algorithm In a resource allocation graph algo, what does it mean when a resource must be claimed "a priori"? before a thread executes, its claims must be on the graph In deadlock detection, what do we use for single instance of each resource type? wait for graph, checking it periodically for a cycle in the graph In deadlock detection, the multiple instance ... algorithm is of what runtime? O(n^2 * m) What are the two methods of deadlock recovery? process/thread termination; resource preemption TRUE/FALSE: when recovering from deadlocks via termination, aborting all deadlocked processes is the only way to do so. FALSE: can also abort processes one by one until the deadlock cycle is eliminated. not as heavy of a loss TRUE/FALSE: whether a process is interactive or a branch is a factor to consider in process abortion. TRUE others include: priority, how much computation done, how long until completed, resources used, resources require to complete, how many processes need termination What are the three things to consider when choosing resource preemption for deadlock recovery? 1. selecting a victim 2. rollback 3. starvation TRUE/FALSE: process scheduling refers to general scheduling concepts whilest thread scheduling refers to threads specifically TRUE What do processes cycle between during execution? CPU and I/O bursts, until the final CPU burst that ends with a system request to terminate execution Which CPU scheduling decisions are preemptive? non preemptive? 1. when a process switches from running -> waiting state 2. when a process switches from running -> ready state 3. when a process switches from waiting -> ready state 4. when a process terminates PREEMPTIVE: 2 AND 3 NONPREEMPTIVE: 1 AND 4 TRUE/FALSE: nearly all modern OS's use non-preemptive scheduling algorithsm FALSE: they use preemptive! What other functions does the Dispatcher have other than giving a selected process access to CPU core? - switching context between processes -switching from kernel -> user - switching to user program's proper location to resume What are the five CPU scheduling criteria? BONUS: what do we want from our scheduling algorithms based on this criteria? CPU utilization, Throughput, turnaround time, waiting time, response time BONUS: max CPU utilization, max throughput, min turnaround time, min waiting time, min response time What is turnaround time? sum of periods waiting in ready queue, CPU execution, and I/O for a given process ( waiting + response time) What is the name of the concept that is the biggest drawback of using FCFS CPU scheduling algorithm? CONVOY EFFECT: all other processes wait for one big process to get of CPU that has priority over them How is the length of a process determined in Shortest Job First (SJF)? the next CPU burst length What is the formula for estimating the next CPU burst? T n + 1 = αtn + (1 - α) Tn ; for 0 <= α <= 1; tn = length of nth CPU burst in SJF, α = 0 would determine what? only history matters when evaluating jobs, α = 1 would mean only the most recent matters What makes Round Robin Scheduling (RR) different from FCFS? uses preemption, the ability to switch between processes in time quantum intervals "q" How does Round Robin (RR) compare to SJF? long wait time, therefore higher average turnaround time, but better response time TRUE/FALSE: In Priority Scheduling, SJF is used when processes have the same priority FALSE, it uses FCFS! What is a fix for priority scheduling's problem with low priority processes experiencing starvation due to an influx of higher priority processes? AGEING: increasing the processes' priority in intervals What does Multilevel Queue Scheduling have over RR/Priority? it houses a different queue for each distinct priority In MQ Scheduling, what routine is uses for foreground queues? background queues? FOREGROUND: RR BACKGROUND: FCFS what are your options for scheduling between queues in MQ? 1. serve all foreground before background in a fixed priority (risks starvation) 2. each queue gets a time slice; a percentage of CPU time What is the modified MQ scheduling algorithm that ages processes that take up too much CPU time? Multilevel Feedback Queue (MFQ) TRUE/FALSE: SJF and FCFS are non-preemptive, whilest the rest of the CPU scheduling algorithms are preemptive TRUE What is the difference between Asymmetric Multiprocessing (AMP) and Symmetric Multiprocessing (SMP)? AMP - only one processor has access to system data structures (no data sharing required, but at the cost of bottlenecks) SMP - each processor is self scheduling What does multicore processing refer to? multiple processor cores on a single chip What does it mean when a processor stalls? memory accessing potentially taking many CPU cycles, therefore not having the data required to complete a given instruction yet What implementation remedies processor stalling? CACHES - fast memory store built into CPU T/F: base and limit registers act as boundaries between each process's memory space. the base register holds smallest legal memory address and the limit register specifies size of range TRUE What are the three methods in which a compiler binds addresses to physical memory addresses? 1. COMPILE TIME 2. LOAD TIME 3. EXECUTION TIME What is a primary downside of compile time address binding? must be recompiled if the starting location ever changes Which method of address binding is most often used in OS? execution time, process can be moved from/to memory segments during execution T/F: Logical/Virtual addresses are loaded by the memory-address register of memory, while the Physical addresses are generated by the CPU. FALSE; other way around! What does it mean for a program to be dynamically loaded, and is it better for larger or smaller programs? routines are not loaded until called; much better for large programs as only a portion of it is loaded at a given time for efficiency What does the acronym DLL stand for? DYNAMICALLY LINKED LIBRARIES; system libraries linked to user programs when programs are run TRUE/FALSE: main memory is not required to accommodate both OS and user processes, therefore doesn't need to be allocated efficiently FALSE What is variable partition? OS keeps track of which parts of memory are available/occupied? What is the term for free memory space broken into little pieces as processes are loaded/removed overtime? external fragmentation Regarding fragmentation, what is the 50% rule? BONUS: what can be done to minimize fragmentation? 0.5 N blocks lost to fragmentation for every 1 N allocated blocks BONUS: compaction, the shuffling of memory to place in one large block T/F: Internal Fragmentation is unused memory that is internal to a partition TRUE What is the memory management technique that permits physical address space to be non-contiguous? Paging on a page table, what is the page # for? used as an index of the base address of each page in physical memory On a page table, what is the page offset for? the index combined with the base address to define physical memory address that is sent to the memory unit What is the acronym TLB stand for? What is its purpose? TRANSLATION LOOK-ASIDE BUFFER: fast lookup hardware cache, helps remedy page tables' slower memory access times [Show More]

Last updated: 8 months ago

Preview 3 out of 9 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Loading document previews for CECS 326 Midterm 2 Study Guide | Questions with Verified Answers

Loading document previews ...

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$13.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

21
0

Document information


Connected school, study & course


About the document


Uploaded On

Mar 25, 2025

Number of pages

9

Written in

All

Seller


Profile illustration for Ajay25
Ajay25

Member since 5 years

133 Documents Sold

Reviews Received
25
4
1
0
4
Additional information

This document has been written for:

Uploaded

Mar 25, 2025

Downloads

 0

Views

 21

Recommended For You

Get more on EXAM »

$13.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·