Font size
Worksheetssystemoperpart2
Total questions: 122
Worksheet time: 61hrs 0mins
In the Producer-Consumer problem, what is the role of the consumer?
To manage the synchronization between multiple producers.
To ensure the buffer is always full.
To remove items from the shared buffer and process them.
To ensure that the producer blocks when the buffer is full.
In the solution to the producer-consumer problem, which of the following is a binary semaphore?
sem
full
n
empty
In the Dining Philosophers problem, which of the following corresponds to process?
philosopher
bowl of rice
chopstick
table
In the Dining Philosophers problem, what is a common strategy to avoid deadlock? Note that you need to make sure that the solution is still correct.
Ensuring that a philosopher keeps on holding onto a chopstick even if the other one is not available.
Allowing each philosopher to eat with only one chopstick.
Ensuring that all philosophers always pick up the left fork first and then the right fork.
After picking up a chopstick if a philosopher finds that the other chopstick is unavailable, s/he will let go of the picked up chopstick.
Suppose you have a counting semaphore S. After certain number of wait() and signal() operations, the value of S is -4. Determine the number of processes waiting on S. Assume semaphore implementation without busy waiting. You do not have to worry about how the value -4 was arrived upon.
-1
-4
3
4
Which of the following is true?
Semaphore implementation with busy waiting may cause the semaphore value to be negative.
wait() and signal() should be executed atomically.
Spinlock does not cause busy waiting.
Peterson’s solution is a hardware-based solution.
In a typical program, which of the following code segments determines which process can next execute the critical section?
exit section
remainder section
entry section
mutual exclusion section
Consider the solution to the producer-consumer problem that you have learnt. Assume that there are multiple producer processes as well as multiple consumer processes executing simultaneously. If the value of the full semaphore is -3 and the value of the empty semaphore is -4, then calculate the total number of blocked processes. Assume semaphore implementation without busy waiting. You do not have to worry about how the values of full and empty semaphores were derived.
7
3
-7
4
Which metric evaluates how efficiently the CPU is used?
CPU Utilization
Turnaround Time
Throughput
Waiting Time
Which performance metric measures the total time from the submission of a process to its completion?
Throughput
Waiting Time
Turnaround Time
CPU Utilization
In non-preemptive scheduling, when is a new process selected to run?
When a higher priority process arrives or when a process finishes its CPU burst.
When a process terminates or when an explicit system request causes a wait state
When a process is created or when a process requests I/O.
When the CPU is idle or when a process is suspended.
What is dispatch latency?
The time taken by the dispatcher to stop one process and start another running.
The time taken by the CPU scheduler to select a process from the ready queue.
The time taken by the system to switch from user mode to kernel mode.
The time taken by a process to complete its CPU burst.
Which scheduler is responsible for deciding which processes should be brought into the ready queue from the job queue?
Medium-term scheduler
Short-term scheduler
Long-term scheduler
I/O scheduler
Which queue contains processes that are waiting for keyboard and a printer?
Job queue
PCB queue
Ready queue
Device queue
Which characteristic is crucial for a scheduling algorithm to minimize in an interactive system, such as an online video game?
Scheduling Time
Response Time
Waiting Time
Throughput
What happens during a context switch?
A. A new process is created.
B. A process is terminated.
C. The CPU is idle.
D. The state of the old process is saved, and the state of the new process is loaded
Which type of process often requires quicker response times and may have higher priority in multilevel queue scheduling?
Foreground processes
Batch processes
Background processes
System processes
What happens if the time quantum in round-robin scheduling is set too small?
There will be high context-switching overhead.
Long CPU burst processes will finish first.
The CPU will be underutilized.
The system behaves like a First-Come, First-Served (FCFS) algorithm.
What is the primary characteristic of applications that fall under real-time systems?
They require large memory usage.
They primarily run in batch mode.
They operate with low latency and provide prompt responses to external stimuli.
They prioritize graphical performance.
In Preemptive Priority Scheduling, what happens when a new process with a higher priority arrives?
The new process waits for the current process to finish.
The process with the lowest burst time is executed.
The current process continues until it finishes.
The new process immediately starts executing, preempting the current process.
How can the issue of starvation be addressed in Priority Scheduling?
By gradually increasing the priority of waiting processes over time
By using a round-robin scheduling algorithm
By increasing the burst time of waiting processes
By decreasing the memory usage of processes
What problem can occur with SJF scheduling if there is a continuous influx of short jobs?
Increased average turnaround time
Starvation of long jobs
Starvation of short jobs
Decreased context switching overhead
What is the finish time for Process P1 if its arrival time is 2 ms and its turnaround time is 15 ms?
13 ms
10 ms
17 ms
20 ms
Which of the following is a characteristic of the Shortest Job First (SJF) scheduling algorithm?
It can be preemptive or non-preemptive.
It is also known as First-Come, First-Served (FCFS) scheduling.
It always leads to starvation for longer processes.
Processes with the longest burst time are executed first.
What is the total burst time for process P1, given that its CPU time is 6 ms followed by an I/O time of 3 ms and another CPU time of 2 ms?
12 ms
11 ms
6 ms
9 ms
What is the response time for Process P4 if its first response time is 13 ms and its arrival time is 5 ms?
5 ms
13 ms
10 ms
8 ms
What is the turnaround time for Process P4 if its arrival time is 5 ms and its finish time is 10 ms?
5 ms
7 ms
10 ms
12 ms
What is the waiting time for Process P1 if its burst time is 8 ms (CPU time + I/O time) and its turnaround time is 12 ms?
6 ms
12 ms
4 ms
8 ms
Which of the following is NOT a criterion used by process scheduling algorithms?
Reducing main memory size
Ensuring fairness among processes
Maximizing CPU utilization
Minimizing turnaround time
What is the main role of the medium-term scheduler?
To decide which processes should be brought into the ready queue from the job queue
To handle the scheduling of processes that are blocked and waiting for I/O resources
To allocate CPU to processes in the ready queue
To temporarily remove processes from main memory and place them on secondary memory, or vice versa
Consider a five state model. Which state transitions invoke the CPU scheduler?
From new to ready, from ready to running, from running to blocked, and process creation
From waiting to running, from ready to running, from running to blocked, and process suspension
From running to waiting, from running to ready, from waiting to ready, and running to termination
From ready to blocked, from running to new, from waiting to running, and process termination
What is the main difference between non-preemptive and preemptive scheduling?
Non-preemptive scheduling does not allow a running process to be interrupted, while preemptive scheduling does.
Neither allows a running process to be interrupted.
Both allow a running process to be interrupted.
Non-preemptive scheduling allows a running process to be interrupted, while preemptive scheduling does not.
Consider 5 processes whose Arrival time and CPU Burst time is as follows (Process no: Arrival time: Burst time): P1: 0,3; P2: 2,3; P3: 3,2; P4: 5,5; P5: 6,9. Assume that the processes are scheduled using the FCFS scheduling algorithm. The average waiting and turnaround time is ______
A) 2.5 and 7.0
B) 2.6 and 7.1
C) 2.8 and 7.2
D) 1.9 and 6.9
What does a cycle in a Resource Allocation Graph indicate when there is only one instance per resource type?
There might be a deadlock.
The system is in a safe state.
There is no deadlock.
There is definitely a deadlock.
Which of the following methods involves taking action to ensure that the system never enters a deadlock state?
Resource Allocation Scheduling
Deadlock Detection and Recovery
Ignoring the problem
Deadlock Prevention and Deadlock Avoidance
What is the correct sequence a process must follow to use a resource in an operating system?
Request, use, release
Lock, unlock, release
Allocate, lock, use
Use, release, request
What is the 'Circular Wait' condition in a deadlock scenario?
Processes are waiting for a resource that is not available.
Processes are holding multiple resources simultaneously.
A set of processes are waiting for each other in a circular chain.
Processes are waiting in a linear sequence.
Which of the following is one of the conditions that must be present for a deadlock to occur?
Infinite Resources
Resource Preemption
Sequential Processing
Mutual Exclusion
In a Resource Allocation Graph, how is a request edge represented?
A directed edge from a process to a resource.
A directed edge from a resource to a process.
An undirected edge between a process and a resource.
A circular edge within a process.
What is a deadlock in a multiprogramming environment?
A situation where processes can always acquire the resources they need.
A scenario where all processes are finished, and resources are released.
A condition where resources are infinite, and processes do not need to wait.
A state where processes are blocked because each is holding a resource and waiting for a resource held by another.
What type of resources require mutual exclusion to prevent deadlocks?
Non-sharable resources
Sharable resources
Virtual resources
Both sharable and non-sharable resources
There are two protocols to avoid Hold and Wait condition. Which protocol requires a process to acquire all needed resources before it begins execution?
The deadlock detection protocol
The second protocol for avoiding Hold and Wait condition
The mutual exclusion protocol
The first protocol for avoiding Hold and Wait condition
What does the No Preemption condition mean in the context of deadlock prevention?
A process cannot be forced to release its resources once they have been allocated.
A process can only hold one resource at a time.
A process can request resources as soon as they become available.
Resources are automatically released after a fixed time period.
What is the main requirement for the Deadlock Avoidance scheme?
The ability to preempt resources at any time.
Processes must acquire all resources before execution begins.
Requires complete information about resource requests and releases from the start.
The system must always be in a deadlock state.
In Deadlock Avoidance, what defines a "safe state"?
The system has entered a deadlock and cannot recover.
There is a sequence of processes that can finish without causing a deadlock.
All resources are allocated without considering future requests.
Processes can hold resources indefinitely.
What happens to a claim edge when a process requests a resource in a Resource Allocation Graph?
It is removed from the graph.
It is converted to a request edge.
It is converted to an assignment edge.
It remains unchanged.
What is the primary purpose of the Banker's Algorithm in deadlock avoidance?
To allocate resources in a way that ensures the system remains in a safe state.
To prevent processes from requesting more resources compared to other processes.
To immediately grant all resource requests.
To reduce the number of processes in the system.
What does the Work vector represent in the Safety Algorithm?
The number of currently available resources.
The total number of resources in the system.
The maximum resources needed by all processes.
The resources currently allocated to each process.
What does a safe sequence indicate in the context of the Safety Algorithm?
The sequence in which processes must release their resources.
The order in which the system should terminate processes.
The order in which processes can be allocated resources without causing a deadlock.
The maximum amount of resources that can be allocated to each process.
What is the primary goal of the Resource Request Algorithm in the Banker's Algorithm?
To terminate processes that exceed their resource requests.
To allocate resources to processes immediately.
To ensure that a resource request can be granted while keeping the system in a safe state.
To calculate the total resources available in the system.
Which of the following techniques is used to handle deadlocks by allowing the system to enter a deadlock state and then detecting it?
Deadlock Prevention
Deadlock Detection
Deadlock Avoidance
Resource Allocation
What type of graph is used in deadlock detection when resources have a single instance?
Wait-for Graph
Resource Allocation Graph
Process Resource Graph
System State Graph
Which of the following data structures are used in the deadlock detection algorithm for systems with multiple resource types?
Process Table, Resource Table
Wait-for Graph, Resource Allocation Graph
Priority Queue, Mutex Locks
Available vector, Allocation matrix, Request matrix
In deadlock detection scheme, what is the main condition that must be checked to determine if a system is in a deadlocked state using the algorithm?
If the Request matrix is empty
If the Work vector has been exhausted
If all processes have completed their execution
If any Finish[i] remains false after all possible allocations
Which method requires the system to have prior information about the resources a process will request and use?
Deadlock Avoidance
Deadlock Detection and Recovery
Deadlock Prevention
Ignoring the problem
Which of the following best describes the role of the mapping function F: R → N in preventing Circular Wait?
It tracks the order in which processes request resources.
It assigns a unique number to each resource type, enforcing an order in which resources must be requested.
It allows processes to request resources in reverse order.
It determines which process should be preempted in case of a deadlock.
How is the Available vector computed in the Banker's Algorithm?
By subtracting the total allocated resources from the total resources
By adding all elements of the Need matrix
By calculating the sum of the resources requested by all processes
By adding the Allocation matrix to the Max matrix
What happens in the second step of the Resource Request Algorithm?
The algorithm rolls back any temporary allocations if the state is not safe.
The algorithm updates the Allocation matrix with the requested resources.
The algorithm checks if the requested resources exceed the process's maximum claim.
The algorithm checks if the requested resources are currently available.
In the deadlock detection algorithm, what action is taken when a process's request is found to be less than or equal to the Work vector?
Ignore the request and continue
Update Work to include the process's Allocation and set Finish [i] to true
Abort the process immediately
Move the process to a waiting state
What is the primary objective of main memory management in an operating system?
Ensuring that memory leaks occur
Handling input and output operations
Allocating and deallocating memory for processes
Managing secondary storage devices
What is the primary goal of a compilation system?
To convert source code into machine code
To edit and debug source code
To manage system resources
To execute source code directly
Which of the following is NOT a requirement of main memory management?
Relocation
Compilation
Sharing
Protection
What is the primary role of the Memory Management Unit (MMU) in an operating system?
To manage disk storage
To generate logical addresses
To allocate memory segments to processes
To translate logical addresses to physical addresses
What is the purpose of address binding in memory management?
To map logical addresses to physical addresses
To convert physical addresses into logical addresses
To allocate memory for new processes
To prevent memory leaks
In a fixed-size partition memory allocation system, how is the degree of multiprogramming determined?
By the size of the main memory.
By the number of partitions created during system initialization.
By the number of processes in the job queue.
By the number of available CPUs.
What is the primary purpose of using overlays in memory management?
To allow programs larger than the available memory to run
To increase the speed of process execution
To allocate fixed-size memory partitions
To reduce the number of processes in the job queue
What is a major drawback of dynamic partition allocation in memory management?
It cannot allocate exact memory requirements.
It restricts the number of processes that can be loaded.
It leads to internal fragmentation.
It can cause external fragmentation.
Which dynamic partition allocation scheme is most likely to minimize wasted space by creating the smallest leftover holes?
Next Fit
First Fit
Best Fit
Worst Fit
Which of the following is a key drawback of the fixed-size memory allocation scheme?
Internal fragmentation
Complex address translation
External fragmentation
Increased page table size
What is the primary benefit of the paging memory allocation scheme?
It reduces the size of the page table.
It completely eliminates internal fragmentation.
It completely eliminates external fragmentation.
It simplifies the process of memory allocation.
If each page contains 2,048 words, and the logical memory has 64 pages, how many bits are required to address it?
18 bits
16 bits
17 bits
9 bits
In a system with 16 frames, each containing 8,192 words, how many bits are needed to address the physical memory?
17 bits
16 bits
15 bits
18 bits
How does segmentation differ from paging in memory management?
Paging uses a page table to manage memory, while segmentation does not use any table.
Segmentation divides the logical space into equal-sized pages, while paging divides it into variable-sized segments.
Paging allows for non-contiguous memory allocation, while segmentation requires contiguous memory allocation for all segments.
Segmentation divides the logical space into variable-sized segments based on the logical structure of the program, while paging divides it into equal-sized pages.
What are the two key values stored in each entry of the segment table?
Base address and limit value
Logical address and physical address
Page offset and segment offset
Frame number and page number
Given a segment table with segment 0 having base = 128 and limit = 500, what is the physical address for logical address (0, 499)?
1280
1024
627
942
For segment 1 with base = 8192 and limit = 1048, what happens when trying to access the logical address (1, 2056)?
The physical address is 1024.
The physical address is 10248.
The address is valid with a physical address of 1024.
The address is invalid, typically causing a segmentation fault.
Which of the following is NOT a key feature of a good main memory management system?
Efficiency in memory allocation and deallocation
Reliable memory allocation to processes
High degree of multiprogramming
Slow memory access times
Which of the following statements about the base and limit registers is FALSE?
The base and limit registers help in enforcing memory protection.
The limit register specifies the size of the memory segment allocated to a process.
The base register holds the starting address of a process's memory segment.
The MMU adds the value in the limit register to the logical address during address translation.
In the context of overlays, what role does the overlay driver play?
It generates machine code during program execution.
It manages fixed-size memory partitions.
It translates logical addresses to physical addresses.
It swaps overlays in and out of memory as needed.
What is the primary purpose of virtual memory in modern computers?
To create the illusion of a large, seamless block of main memory
To eliminate the need for disk storage
To reduce the size of the programs being run
To increase the amount of physical RAM in the system
What problem does virtual memory help to solve when dealing with large programs?
It eliminates the need for swapping.
It prevents programs from accessing main memory.
It ensures that the entire program is loaded into memory at once.
It reduces the large physical memory required to run programs.
What is the role of the Memory Management Unit (MMU) in virtual memory?
It eliminates the need for a page table.
It translates virtual addresses into physical addresses.
It increases the physical memory available to the system.
It allocates memory directly to processes.
What happens if there is no free frame in physical memory when a processor generates a virtual address for a new page?
The program execution is paused until memory is available.
The system crashes.
The MMU allocates more physical memory.
An existing page is swapped out to make space for the new page.
What is the main disadvantage of traditional paging compared to demand paging?
It swaps out individual pages instead of the entire process
It only loads pages as needed, leading to inefficient memory usage
It loads the entire program into memory, which might not be necessary
It requires complex page replacement algorithms
What is the primary role of a 'pager' in demand paging?
To secure pages in memory against unauthorized access
To load individual pages into memory as they are needed
To manage the CPU scheduling
To load the entire process into memory at once
Which algorithm deals with the frames that need to be replaced in demand paging?
Priority allocation algorithm
Proportional allocation algorithm
Page replacement algorithm
Frame allocation algorithm
Why are page replacement algorithms essential in virtual memory systems?
They extend physical memory without using disk storage
They allocate more memory to the operating system
They prevent the operating system from using virtual memory
They ensure that the most relevant pages are kept in physical memory
What is a significant disadvantage of the FIFO replacement algorithm?
It requires complex bookkeeping
It can lead to higher page fault rates due to Belady’s Anomaly
It requires future knowledge of memory access patterns
It is difficult to implement
Why is the FIFO algorithm considered predictable?
It frequently accesses pages in memory
It uses a complex algorithm to determine page replacement
It uses a random approach for page replacement
It operates in a controlled environment with known behavior
What is one key advantage of the LRU algorithm?
It minimizes page faults by replacing the least recently used page
It is the simplest page replacement algorithm to implement
It requires no tracking of page usage
It always outperforms the Optimal Page Replacement algorithm
What is a common method used by the LRU algorithm to keep track of page usage?
Using a queue data structure
Using a hashmap to count page references
Using a stack data structure or counters
Using the timestamp of when pages are loaded
What is the main principle behind the Optimal Page Replacement (OPT) algorithm?
Replaces the page that has not been used for the longest time
Replaces the page with the fewest references in the past
Replaces the page that has been in memory the longest
Replaces the page that will not be used for the longest period in the future
How does virtual memory improve CPU utilization and throughput?
By allowing more programs to be loaded into the main memory
By eliminating the need for multiprogramming
By increasing the amount of physical memory available
By loading entire programs into the main memory
What is a significant difference between paging and virtual memory?
Paging uses logical addresses, while virtual memory uses physical addresses.
Paging requires the entire program to be in main memory, while virtual memory does not.
Paging divides memory into fixed-size blocks, while virtual memory does not.
Virtual memory eliminates the need for physical memory.
What hardware support is necessary to implement demand paging?
Primary memory
Frame allocation algorithm
High-speed processor
Valid-invalid bit
Which page replacement algorithm assumes that pages used recently will be needed again soon?
LFU
FIFO
OPT
LRU
What is a significant drawback of the Optimal Page Replacement (OPT) algorithm?
It is too simple and often yields poor performance
It assumes pages used recently will not be needed again
It requires future knowledge of memory access patterns
It replaces the oldest page in memory
What is the primary purpose of mass storage in computing systems?
To provide temporary storage for data being actively processed by the CPU
To manage the system’s random access memory (RAM)
To enhance the speed of data processing
To store large amounts of data persistently and reliably
Which of the following is a benefit of solid-state drives (SSDs) compared to hard disk drives (HDDs)?
Faster and more durable
Uses magnetic fields for data storage
Higher capacity at a lower cost
Better for archival storage
What material is most commonly used for making platters in modern magnetic disk drives?
Aluminium
Silicon
Plastic
Glass
What material is most commonly used for making platters in modern magnetic disk drives?
Aluminium
Silicon
Plastic
Glass
How do you calculate the total capacity of a magnetic disk?
By multiplying the rotational speed by the number of platters
By multiplying the number of bytes per sector, sectors per track, tracks per surface, surfaces per platter, and platters per disk
By adding the number of tracks and platters
By dividing the number of sectors by the number of tracks
How is data stored and accessed on a magnetic tape?
Sequentially, by winding and rewinding the tape past a read-write head
On a series of platters rotating at high speeds
In fixed blocks, similar to how data is stored on a hard disk
Randomly, allowing instant access to any data point
What is the typical size of a logical block in modern magnetic disk drives?
2,048 bytes
512 bytes
256 bytes
1,024 bytes
What is one characteristic of host-attached storage?
It cannot support more than one storage device at a time.
It uses local I/O ports to connect storage devices to the computer.
It is typically accessed over a data network using protocols like NFS or CIFS.
It is less efficient and has lower performance compared to NAS.
Why is random access on magnetic tapes about a thousand times slower than on magnetic disks?
Because of frequent mechanical failures
Because tapes have a higher data transfer rate
Due to the sequential nature of tape storage
Due to the higher density of data on tapes
How is disk bandwidth calculated?
The total number of I/O requests completed per second
Total number of bytes transferred divided by the total time between the first request and the completion of the last transfer
The difference between the disk’s maximum and minimum transfer rates
The sum of seek time and rotational latency
What information does a disk I/O request contain when issued by a process?
The memory address for the transfer, and the number of sectors to be transferred
Only the disk address for the transfer
Whether the operation is an input or output, the disk address for the transfer, the memory address for the transfer, and the number of sectors to be transferred
Whether the operation is an input or output, and the number of sectors to be transferred
What is a significant drawback of the FCFS disk scheduling algorithm?
It is too complex to implement.
It can result in substantial and inefficient total head movement.
It always provides the fastest service.
It unfairly prioritizes certain requests
What is the main goal of the SSTF Disk Scheduling algorithm?
To service the requests that are farthest from the current head position
To process disk I/O requests in the exact order they arrive
To service the request closest to the current head position to minimize seek time
To reorder requests based on their priority
Which of the following is a main advantage of the SCAN algorithm?
It has the highest seek time compared to other algorithms.
It minimizes starvation and provides uniform wait times.
It services requests in the order they arrive
It always services the shortest request first
How does the C-SCAN algorithm differ from the traditional SCAN algorithm in terms of disk head movement?
C-SCAN services requests in one direction and jumps back to the beginning, while SCAN services requests in both directions.
C-SCAN services requests in both directions while SCAN services only in one direction.
C-SCAN services requests based on priority, while SCAN services in the order they arrive.
C-SCAN moves randomly across the disk, while SCAN follows a specific pattern.
What is the primary purpose of low-level formatting, or physical formatting, on a disk?
To set up specific data structures for each sector, including headers and trailers
To partition the disk into logical groups of cylinders
To initialize the mapping of logical block numbers to defect-free sectors
To write initial file-system data structures to the disk
What happens during the partitioning step when setting up a disk for use?
The disk is formatted with larger sector sizes to optimize storage efficiency.
The initial file-system data structures are written to the disk.
The disk is prepared with specific data structures for each sector.
The disk is divided into one or more groups of cylinders.
What is the primary function of swap space in operating systems?
To manage the allocation of physical memory to virtual memory
To provide a buffer for incoming data to avoid system crashes
To store individual pages that have been pushed out of main memory
To store entire processes, including image, code, and data segments
What is a primary characteristic of RAID 0?
Enhances performance by striping data across multiple disks
Mirrors data across multiple disks for redundancy
Utilizes block-level striping and distributed parity
Provides high redundancy and fault tolerance
What does stable storage ensure?
Information in storage is never lost.
Information in storage is occasionally lost.
Information is only intact if there are no errors.
Information is lost during disk errors but not CPU errors
How is reliable storage achieved?
By using a single storage device
By ignoring write coordination
By writing data without recovery processes
By replicating information on multiple storage devices with independent failure modes
Which of the following is NOT a characteristic of mass storage devices?
Volatile storage
High capacity
Error-checking mechanisms
Data persistence
Given the FCFS algorithm, what would be the total head movement for a disk queue with requests for cylinders in the following order: 10, 20, 30, 40, 50, 60, starting from cylinder 25?
120 cylinders
65 cylinders
95 cylinders
100 cylinders
Which method for managing bad blocks involves replacing a defective sector with a spare sector?
Sector locking
Sector scrubbing
Sector slipping
Sector sparing
Which RAID level uses byte-level striping with a dedicated parity disk?
RAID 0
RAID 1
RAID 3
RAID 5
