100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CECS 326 Midterm 2 Study Guide | Questions with Verified Answers

Rating
-
Sold
-
Pages
9
Grade
A
Uploaded on
25-03-2025
Written in
2024/2025

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, often 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: SityHashCode(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 Read less
Institution
CECS 326
Course
CECS 326









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CECS 326
Course
CECS 326

Document information

Uploaded on
March 25, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CECS 326 Midterm 2 Study Guide



Which OS's sweep deadlocks under the rug and pretend they don't exist as a method
for handling deadlocks?
Linux and Windows, often 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.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Bri254 Rasmussen College
View profile
Follow You need to be logged in order to follow users or courses
Sold
896
Member since
5 year
Number of followers
738
Documents
3399
Last sold
2 weeks ago
Best Tutorials, Exam guides, Homework help.

When assignments start weighing you down, take a break. I'm here to create a hassle-free experience by providing up-to-date and recent study materials. Kindly message me if you can't find your tutorial and I will help.

4.0

179 reviews

5
106
4
20
3
25
2
5
1
23

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions