Logo/

Deadlock and Memory Management in OS

Log in

Made with ScholarlyMake flashcards like these from your own notes

Deadlock and Memory Management in OS

Questions and answers

47 cards
  1. 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.

  2. Question:Name the four necessary conditions for deadlock.

    Answer:Mutual exclusion, Hold and wait, No preemption, Circular wait

  3. Question:What is the Dining Philosophers problem used to illustrate?

    Answer:Resource sharing issues like deadlock, starvation, and mutual exclusion in concurrent programming

  4. Question:How can deadlock be prevented?

    Answer:Break one of the four conditions (e.g., prevent hold and wait)

  5. Question:What does deadlock avoidance aim to do?

    Answer:Keep the system in a safe state by planning resource allocations

  6. Question:What is the Banker’s algorithm used for?

    Answer:Safe-state checking to avoid deadlocks during resource allocation

  7. Question:What is a Resource Allocation Graph (RAG)?

    Answer:A graph showing which resources are held or requested by processes to detect deadlocks

  8. Question:What indicates deadlock in a single-instance RAG cycle?

    Answer:A cycle implies deadlock when each resource has only one instance

  9. Question:What can be done if a deadlock is detected?

    Answer:Terminate processes or preempt resources to recover

  10. Question:What is the key difference between preemption and non-preemption?

    Answer:Preemption allows taking resources away; non-preemption does not

  11. Question:What is the purpose of the semaphore in the Dining Philosophers solution?

    Answer:Represent each chopstick as a mutex to control access

  12. Question:What is the odd-even fork-pick strategy?

    Answer:Even IDs pick left then right; odd IDs pick right then left

  13. Question:What is the primary goal in the Reader-Writer problem?

    Answer:Allow multiple readers or a single writer with exclusive access

  14. Question:Which solution gives writers priority over new readers in Reader-Writer?

    Answer:Writer Preference Solution

  15. Question:What does memory refer to in computing?

    Answer:Storage space for data and instructions used by CPU

  16. Question:Name two types of memory.

    Answer:Primary (RAM, cache, ROM) and Secondary (HDD, SSD, etc.)

  17. Question:What is memory fragmentation?

    Answer:Inefficient memory use due to unusable free spaces or wasted blocks

  18. Question:What is internal fragmentation?

    Answer:Wasted space within allocated memory blocks

  19. Question:What is external fragmentation?

    Answer:Free memory is in non-contiguous holes, unusable for large requests

  20. Question:Define contiguous memory allocation.

    Answer:Each process occupies one continuous memory block

  21. Question:What is fixed partitioning in memory management?

    Answer:Memory divided into fixed-size partitions with one process per partition

  22. Question:What is dynamic (variable) partitioning?

    Answer:Partitions created to fit exact process size, reducing internal fragmentation

  23. Question:What is paging in non-contiguous allocation?

    Answer:Memory is divided into fixed-size pages and frames; pages map to frames

  24. Question:What is a page fault?

    Answer:Access to a page not currently in main memory

  25. Question:Name three page replacement algorithms.

    Answer:FIFO, LRU, Optimal

  26. Question:What is Belady’s Anomaly?

    Answer:More memory can cause more page faults under FIFO

  27. Question:What is multilevel paging?

    Answer:Page table divided into multiple levels to reduce memory overhead

  28. Question:What is inverted paging?

    Answer:One page table for the entire system with frame-level entries

  29. Question:What is segmentation in memory management?

    Answer:Memory divided into variable-sized segments by logical divisions

  30. Question:What is thrashing?

    Answer:System spends more time swapping pages than executing processes

  31. Question:Define degree of multiprogramming.

    Answer:Number of processes in main memory ready to run

  32. Question:What is a page table?

    Answer:Data structure mapping logical pages to physical frames

  33. Question:What is a safe state in Banker's Algorithm?

    Answer:There exists a sequence where all processes finish without deadlock

  34. Question:What is an unsafe state in Banker's Algorithm?

    Answer:No guaranteed sequence to finish all processes safely

  35. Question:What is the Need matrix in Banker's Algorithm?

    Answer:Need[i,j] = Max[i,j] - Allocation[i,j]

  36. Question:What does the Available array represent?

    Answer:Number of free instances of each resource type

  37. Question:What is the concept of memory swapping?

    Answer:Moving processes between RAM and secondary storage to free space

  38. Question:What is the difference between static and dynamic linking?

    Answer:Static copies libraries into executable; dynamic links at runtime

  39. 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

  40. Question:What is the primary purpose of memory management techniques?

    Answer:Efficient allocation, utilization, and protection of memory

  41. Question:What is the main idea behind multiprogramming?

    Answer:Hide I/O waits by switching to other ready programs

  42. Question:What is the purpose of a page offset in paging?

    Answer:Locates the exact position within a page

  43. Question:What is the concept of non-contiguous allocation beneficial for?

    Answer:Avoids needing a single large contiguous block; reduces external fragmentation

  44. Question:What does the term ‘edge’ refer to in a Resource Allocation Graph?

    Answer:Arrows representing requests or allocations between processes and resources

  45. Question:In the Dining Philosophers, what problem does “deadlock” refer to?

    Answer:All philosophers waiting forever for forks

  46. Question:What is the primary limitation of the Optimal page replacement algorithm?

    Answer:Cannot be implemented in practice due to future knowledge requirement

  47. 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