We read your photo as:

Explain any Four differences between paging and segmentation as used in Memory Management? Using an example, explain the operating of 'Shortest Remaining Time, SRT scheduling technique?

Computer Science

ScanSolve AI Answer

Here are the answers to the remaining questions:

QUESTION ONE

d) Explain any Four differences between paging and segmentation as used in Memory Management?
Here are four differences between paging and segmentation:

  • Size of Blocks: In paging, memory is divided into fixed-size blocks called pages (logical memory) and frames (physical memory). In segmentation, memory is divided into variable-size blocks called segments, which correspond to logical units of a program (e.g., code, data, stack).
  • Logical View: Paging provides a non-logical view of memory to the user, as pages are arbitrary divisions. Segmentation provides a logical view of memory, where segments correspond to meaningful program units.
  • Fragmentation: Paging suffers from internal fragmentation (unused space within a page) but avoids external fragmentation. Segmentation can suffer from external fragmentation (unused space between segments) but avoids internal fragmentation.
  • User Awareness: In paging, the user is generally unaware of the page structure. In segmentation, the user is aware of the segments as logical units of their program.

e) Using an example, explain the operating of 'Shortest Remaining Time, SRT scheduling technique as one of the approaches used in design of algorithms in Operating systems
The Shortest Remaining Time (SRT) scheduling technique is a preemptive version of Shortest Job First (SJF). It executes the process with the smallest remaining burst time. If a new process arrives with a shorter remaining burst time than the currently executing process, the CPU is preempted, and the new process starts executing.

Example:
Consider three processes:

  • P1P_1: Arrival Time = 0, Burst Time = 8
  • P2P_2: Arrival Time = 1, Burst Time = 4
  • P3P_3: Arrival Time = 2, Burst Time = 9
  1. At time 0, P1P_1 arrives and starts executing (remaining time = 8).
  2. At time 1, P2P_2 arrives. P1P_1 has 7 units remaining, P2P_2 has 4 units. Since P2P_2 has a shorter remaining time, P1P_1 is preempted, and P2P_2 starts executing.
  3. At time 2, P3P_3 arrives. P2P_2 has 3 units remaining, P1P_1 has 7 units, P3P_3 has 9 units. P2P_2 still has the shortest remaining time, so it continues.
  4. P2P_2 finishes at time 5 (1 unit of execution + 4 units of execution).
  5. At time 5, P1P_1 (remaining 7) and P3P_3 (remaining 9) are in the ready queue. P1P_1 has the shortest remaining time, so it resumes execution.
  6. P1P_1 finishes at time 12 (5 units of execution + 7 units of execution).
  7. At time 12, only P3P_3 (remaining 9) is left. It starts executing.
  8. P3P_3 finishes at time 21 (12 units of execution + 9 units of execution).

f) State three approaches used to handle deadlocks
Three approaches used to handle deadlocks are:

  1. Deadlock Prevention: This approach ensures that at least one of the four necessary conditions for deadlock (mutual exclusion, hold and wait, no preemption, circular wait) cannot hold.
  2. Deadlock Avoidance: This approach requires the operating system to have prior information about resource requests. It dynamically checks if granting a resource request would lead to an unsafe state and only grants requests that
Was this helpful?

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question
Handwritten step-by-step solution preview

Handwritten Step-by-Step Solution

Get this as a handwritten image on WhatsApp — like a tutor wrote it for you.

Try on WhatsApp