Introduction
This question tested the following operating system concepts:
| Concept1 | Description |
|---|---|
| Program vs. Process | Differentiation between a program (a set of instructions on storage) and a process (an executing program with allocated resources in the CPU and memory). |
| Process States and Transitions | Understanding the various states a process can be in (running, ready, waiting, finished) and the reasons for transitions between these states. |
| Deadlock | Comprehension of the condition where two or more processes are waiting indefinitely for each other to release resources. |
| Multitasking vs. Multiprocessing | Distinction between multitasking (managing multiple tasks by time-sharing a single CPU) and multiprocessing (managing tasks across multiple CPUs for parallel execution). |
| Virtual Memory | Discussion on why modern computers use virtual memory, how it works through paging and swapping, and the disadvantages of excessive reliance on virtual memory, such as thrashing. |
- Introduction
- Part a)
- Part b) i)
- Part b) ii)
- Part b) iii)
- Part c)
- Part d)
- Part e) i)
- Part e) ii)
- Part e) iii)
- Footnotes
Part a)
A program is a set of computer instructions that is stored on secondary storage, and a process is a program that is currently being executed on the cpu, it’s instructions and data are stored in main memory – RAM and registers in the CPU.
Part b) i)
It’s time on the CPU has expired.
Part b) ii)
It is waiting on data from an IO operation and cannot continue until it receives the data.
Part b) iii)
The process has completed all of its instructions and no longer needs any of it’s previous system resources.
Part c)
P1 is using d1,
P2 is using d1,
Eventually p1 needs d2 also, it is put into a waiting state.
P2 needs d1, but d1 is in use by p1 and p1 is waiting on p2 to release d2.
P2 will be put into a waiting state
Both process are waiting on each other and will not release the DVD resources that they are allocated, thus neither process can complete and thus we say they are deadlocked.
Part d)
Windows 10, is a multitasking operating system, tasks share time on the CPU.
Linux is a multiprocessing operating system allowing for the running of separate tasks on separate CPUs, thus achieving higher performance.
Further explanation
All present-day operating systems support multitasking and multiprocessing, there are cases where multiprocessing may not be used, e.g where an embedded system is designed for specific task that doesn’t require much processing power.
Part e) i)
Sometimes many processes need to be run simultaneously, and the needs for physical memory can exceed the actual memory that is available.
Part e) ii)
Multiple page frames are created for each process. Ideally, the currently running’s process’s frames are stored in physical ram, and all other ready or waiting processes are stored in ram. As more processes are run which exceed the physical ram capacity, the page frames for the ready and waiting processes are swapped out of physical ram onto the page file on the hard disk to accommodate running processes. When a running process is put into waiting/ready state, it may be put on the virtual page file, and the next process to be run can be put from the virtual page file back into the physical ram to be run.
Part e) iii)
The system can operate inefficiently since a lot of swapping may occur, and this is dependent on the much slower hard disk memory access for each swap. This condition is know as thrashing.
Footnotes
- TA-Note ↩︎
© 2023 Vedesh Kungebeharry. All rights reserved.