BSCS Bachelor of Science in Computer Science: Operating Systems Concepts 3 — Questions and Answers
Question 1: Which inter-process communication (IPC) mechanism allows processes to communicate by writing to and reading from a shared region of memory?
- Message passing
- Shared memory (Correct answer)
- Pipes
- Sockets
Correct answer: Shared memory
Shared memory IPC maps the same physical memory into the address spaces of multiple processes, enabling direct data exchange without kernel involvement on each read/write.
Question 2: In a segmentation memory model, a segment table entry typically contains:
- Only the physical page number
- A base address and a limit (length) for the segment (Correct answer)
- The number of free frames available
- A dirty bit and an access bit only
Correct answer: A base address and a limit (length) for the segment
Each segment table entry holds the base physical address where the segment starts and a limit that enforces the segment's size boundary.
Question 3: What distinguishes a daemon process from a regular user process in Unix/Linux?
- Daemons always have real-time priority
- Daemons run in the background without a controlling terminal (Correct answer)
- Daemons can only be created by root
- Daemons are single-threaded by design
Correct answer: Daemons run in the background without a controlling terminal
A daemon is a background process detached from any terminal, typically started at boot and running continuously to provide system services.
Question 4: The working set model in virtual memory is primarily used to:
- Estimate the number of pages a process actively uses in a time window (Correct answer)
- Determine the optimal page size for the system
- Schedule disk I/O requests efficiently
- Prevent buffer overflow attacks
Correct answer: Estimate the number of pages a process actively uses in a time window
The working set model tracks the set of pages a process has referenced within a recent time window to guide frame allocation and prevent thrashing.
Question 5: In POSIX, which system call creates a new process that is an exact copy of the calling process?
- exec()
- clone()
- fork() (Correct answer)
- spawn()
Correct answer: fork()
fork() creates a child process with a copy-on-write duplicate of the parent's address space, file descriptors, and state.
Question 6: What is the effect of setting the dirty bit on a page in a page table?
- The page is marked for immediate eviction
- The page has been modified and must be written back to disk before eviction (Correct answer)
- The page is locked in memory and cannot be swapped
- The page table entry is invalid
Correct answer: The page has been modified and must be written back to disk before eviction
A dirty (modified) bit indicates the page has been written to since it was loaded; the OS must write it to backing store before reusing the frame.
Question 7: Which scheduling metric measures the total time from process submission to completion?
- CPU utilization
- Throughput
- Turnaround time (Correct answer)
- Response time
Correct answer: Turnaround time
Turnaround time is the interval from when a process enters the ready queue to when it finishes execution, including waiting and service time.
Which inter-process communication (IPC) mechanism allows processes to communicate by writing to and reading from a shared region of memory?