Made with ScholarlyMake flashcards like these from your own notes
Question:What is a deadlock in an operating system?
Answer:A set of processes blocked, each holding a resource and waiting for another held by another process.
Question:Name the four necessary conditions for deadlock.
Answer:Mutual exclusion, Hold and wait, No preemption, Circular wait
Question:What is the Dining Philosophers problem used to illustrate?
Answer:Resource sharing issues like deadlock, starvation, and mutual exclusion in concurrent programming
Question:How can deadlock be prevented?
Answer:Break one of the four conditions (e.g., prevent hold and wait)
Question:What does deadlock avoidance aim to do?
Answer:Keep the system in a safe state by planning resource allocations
Question:What is the Banker’s algorithm used for?
Answer:Safe-state checking to avoid deadlocks during resource allocation
Question:What is a Resource Allocation Graph (RAG)?
Answer:A graph showing which resources are held or requested by processes to detect deadlocks
Question:What indicates deadlock in a single-instance RAG cycle?
Answer:A cycle implies deadlock when each resource has only one instance
Question:What can be done if a deadlock is detected?
Answer:Terminate processes or preempt resources to recover
Question:What is the key difference between preemption and non-preemption?
Answer:Preemption allows taking resources away; non-preemption does not
Question:What is the purpose of the semaphore in the Dining Philosophers solution?
Answer:Represent each chopstick as a mutex to control access
Question:What is the odd-even fork-pick strategy?
Answer:Even IDs pick left then right; odd IDs pick right then left
Question:What is the primary goal in the Reader-Writer problem?
Answer:Allow multiple readers or a single writer with exclusive access
Question:Which solution gives writers priority over new readers in Reader-Writer?
Answer:Writer Preference Solution
Question:What does memory refer to in computing?
Answer:Storage space for data and instructions used by CPU
Question:Name two types of memory.
Answer:Primary (RAM, cache, ROM) and Secondary (HDD, SSD, etc.)
Question:What is memory fragmentation?
Answer:Inefficient memory use due to unusable free spaces or wasted blocks
Question:What is internal fragmentation?
Answer:Wasted space within allocated memory blocks
Question:What is external fragmentation?
Answer:Free memory is in non-contiguous holes, unusable for large requests
Question:Define contiguous memory allocation.
Answer:Each process occupies one continuous memory block
Question:What is fixed partitioning in memory management?
Answer:Memory divided into fixed-size partitions with one process per partition
Question:What is dynamic (variable) partitioning?
Answer:Partitions created to fit exact process size, reducing internal fragmentation
Question:What is paging in non-contiguous allocation?
Answer:Memory is divided into fixed-size pages and frames; pages map to frames
Question:What is a page fault?
Answer:Access to a page not currently in main memory
Question:Name three page replacement algorithms.
Answer:FIFO, LRU, Optimal
Question:What is Belady’s Anomaly?
Answer:More memory can cause more page faults under FIFO
Question:What is multilevel paging?
Answer:Page table divided into multiple levels to reduce memory overhead
Question:What is inverted paging?
Answer:One page table for the entire system with frame-level entries
Question:What is segmentation in memory management?
Answer:Memory divided into variable-sized segments by logical divisions
Question:What is thrashing?
Answer:System spends more time swapping pages than executing processes
Question:Define degree of multiprogramming.
Answer:Number of processes in main memory ready to run
Question:What is a page table?
Answer:Data structure mapping logical pages to physical frames
Question:What is a safe state in Banker's Algorithm?
Answer:There exists a sequence where all processes finish without deadlock
Question:What is an unsafe state in Banker's Algorithm?
Answer:No guaranteed sequence to finish all processes safely
Question:What is the Need matrix in Banker's Algorithm?
Answer:Need[i,j] = Max[i,j] - Allocation[i,j]
Question:What does the Available array represent?
Answer:Number of free instances of each resource type
Question:What is the concept of memory swapping?
Answer:Moving processes between RAM and secondary storage to free space
Question:What is the difference between static and dynamic linking?
Answer:Static copies libraries into executable; dynamic links at runtime
Question:What is the difference between first fit and best fit strategies?
Answer:First fit uses first large enough hole; best fit uses smallest adequate hole
Question:What is the primary purpose of memory management techniques?
Answer:Efficient allocation, utilization, and protection of memory
Question:What is the main idea behind multiprogramming?
Answer:Hide I/O waits by switching to other ready programs
Question:What is the purpose of a page offset in paging?
Answer:Locates the exact position within a page
Question:What is the concept of non-contiguous allocation beneficial for?
Answer:Avoids needing a single large contiguous block; reduces external fragmentation
Question:What does the term ‘edge’ refer to in a Resource Allocation Graph?
Answer:Arrows representing requests or allocations between processes and resources
Question:In the Dining Philosophers, what problem does “deadlock” refer to?
Answer:All philosophers waiting forever for forks
Question:What is the primary limitation of the Optimal page replacement algorithm?
Answer:Cannot be implemented in practice due to future knowledge requirement
Question:What is the key difference between synchronous and asynchronous resource access in OS?
Answer:Synchronous involves coordinated access; asynchronous allows concurrent access with control