AIOU LIBRARY • READ ONLY
AIOULIBRARY.COM • CODE 3501
AIOU LIBRARY • DO NOT COPY
Unit 3: Operating Systems and System Software
Easy Chapter Introduction & Learning Objectives
Welcome to Unit 3 of Course 3501 (BSCS Computing). In this unit, we are going to explore the core building block of computer software: the Operating System (OS) and other essential System Software. If computer hardware is like the physical bricks and mortar of a building, the Operating System is the master architect, engineer, and security guard all rolled into one.
Imagine buying a brand new laptop from a market in Lahore or Karachi. Without an Operating System installed—like Windows, Linux, or macOS—that laptop is just an expensive collection of silicon, plastic, and metal. It will not turn on, you cannot play games, you cannot type notes, and you cannot connect to the internet. The Operating System breathes life into the machine. It manages your files, shares your internet connection, allows multiple programs to run at the same time, and makes sure that the keyboard, mouse, and screen all talk to each other smoothly.
As distance-learning students of Allama Iqbal Open University (AIOU), studying this unit will help you understand how your computer actually thinks and works behind the scenes. Whether you are writing a C++ program, browsing a web page, or submitting an assignment online, an Operating System is working hard underneath to make it happen. Let us look at what you will be able to achieve by the end of this comprehensive study guide:
- Understand the Role of an OS: Learn what an Operating System is, why every computer needs one, and what core functions it performs daily.
- Master Process Management: Understand how a computer handles multiple tasks at once through processes, threads, and CPU scheduling.
- Evaluate CPU Scheduling Algorithms: Compare different methods that the CPU uses to decide which task gets executed first.
- Explore Memory Management: Learn how RAM is divided, protected, and expanded using Virtual Memory and paging techniques.
- Navigate File Systems and Storage: Discover how data is organized, stored, and retrieved on hard drives and solid-state drives.
- Understand System Deadlocks: Learn what happens when programs get stuck waiting for each other forever, and how modern operating systems prevent or solve this issue.
Detailed Explanation of Every Unit Topic
1. Introduction to Operating Systems and Functions
An Operating System (OS) is a large software program that acts as an intermediary between the computer hardware and the computer user/applications. Think of it as the manager of an office. The employees (application programs like MS Word, VLC Player, or Web Browsers) need resources like desks, computers, and stationery (hardware like CPU, RAM, and Hard Disk). The manager (OS) ensures that everyone gets what they need fairly, efficiently, and without fighting.
Core Functions of an Operating System:
- Processor Management: Deciding which program uses the CPU and for how long.
- Memory Management: Tracking how much RAM is being used and by which program, ensuring programs do not steal each other's memory space.
- Device Management: Controlling peripheral devices like printers, keyboards, monitors, and USB drives through special programs called device drivers.
- File Management: Organizing, creating, deleting, copying, and securing files and folders on storage drives.
- Security and Access Control: Protecting the computer from unauthorized users through passwords, user accounts, and permissions.
Real-Life Example: Imagine a busy bank branch in Islamabad. The bank manager (OS) ensures that customers are served in an orderly manner at different counters (hardware devices), handles customer records safely in filing cabinets (file system), and makes sure two tellers do not try to update the exact same account balance at the exact same second (synchronization).
2. Process Management and Threading
In computing, a Process is simply a program that is currently in execution. For example, when you double-click the Google Chrome icon on your desktop, the OS creates a process for Chrome. A computer might look like it is doing many things at once—playing music, downloading a file, and typing an assignment—but in reality, a single CPU core is switching between these tasks at lightning speed.
Inside every process, there can be smaller units of execution called Threads. While a process is like an entire factory, a thread is like an individual worker inside that factory. Multiple threads within the same process share the same memory and resources, making communication between them very fast.
Key Concepts in Process Management:
- Process Control Block (PCB): A special data structure maintained by the OS for every process. It stores important information like Process ID (PID), current state (running, waiting, ready), CPU registers, and memory limits.
- Context Switching: The process of saving the state of a currently running task and loading the state of the next task so the CPU can switch between them. If done too often, it can slow down the computer (called thrashing or overhead).
- Multithreading: Allowing a single application to perform multiple tasks simultaneously. For instance, in Microsoft Word, one thread handles your typing, another checks your spelling in the background, and a third autosaves your document.
Real-Life Example: Think of a chef running a kitchen. The chef (CPU) works on making a biryani (Process A). Suddenly, the phone rings, so the chef stops stirring the rice, notes where they left off (Context Switch), answers the phone (Process B), and then comes back to the rice, picking up right where they stopped.
3. CPU Scheduling Algorithms
Since a computer usually has far more processes ready to run than it has CPU cores available, the OS must use CPU Scheduling Algorithms to decide the order of execution. The main goal is to maximize CPU utilization, minimize waiting time, and ensure fairness.
Common CPU Scheduling Algorithms:
- First-Come, First-Served (FCFS): The simplest algorithm. Whichever process arrives first gets the CPU first. Disadvantage: The "Convoy Effect"—if a long process arrives first, all other short processes must wait behind it, just like cars stuck behind a slow truck on a single-lane road in rural Sindh.
- Shortest Job First (SJF): The process with the smallest execution time is selected next. This minimizes the average waiting time, but it is hard to predict exactly how long a new task will take.
- Round Robin (RR): Each process is given a small, fixed amount of CPU time called a Time Quantum (e.g., 10 milliseconds). Once the time expires, the process is moved to the back of the queue, and the next process gets a turn. This is widely used in modern interactive systems because it gives everyone a fair share.
- Priority Scheduling: Every process is assigned a priority number. The CPU executes the highest-priority process first. Risk: Starvation—low-priority processes might wait forever if high-priority processes keep arriving.
Real-Life Example: Think of a ticket counter at a railway station in Rawalpindi. FCFS is the standard queue where you are served in the exact order you joined. Round Robin is like giving every person at the counter 2 minutes to buy their ticket; if they are not done, they must step to the back of the line so the next person gets a turn.
4. Memory Management and Virtual Memory
The main memory of a computer is Random Access Memory (RAM). RAM is fast, but it is expensive and volatile (it clears when the computer turns off). The Operating System must manage RAM carefully so that different running programs do not overwrite each other's data.
Key Memory Management Concepts:
- Contiguous Memory Allocation: Each program is given a single, unbroken block of RAM. While simple, it leads to wasted space called fragmentation.
- Paging: A clever technique where physical RAM is broken down into fixed-size blocks called frames, and programs are broken into matching blocks called pages. The OS uses a Page Table to map program pages to physical RAM frames, meaning a program's parts do not need to sit next to each other in RAM.
- Virtual Memory: A technique that makes your computer think it has much more RAM than it actually does. When physical RAM is full, the OS moves inactive program pages to a designated space on the hard disk or SSD (called the swap space or page file) and brings them back into RAM only when the user clicks on them.
Real-Life Example: Imagine your office desk (RAM) is small, and you only have space for 3 files at a time. When a 4th file arrives, you do not throw away your work; you place it temporarily in a filing cabinet drawer behind you (Virtual Memory on Hard Disk). When you need that 4th file again, you swap it with one of the files currently on your desk.
5. File Systems and Storage Management
A File System is the method and data structure that an operating system uses to control how data is stored, organized, and retrieved on storage devices like Hard Disk Drives (HDDs) and Solid State Drives (SSDs). Without a file system, information placed on a storage disk would be one massive, unorganized ocean of binary data with no way to tell where one file ends and another begins.
Common File Systems:
- FAT32 (File Allocation Table): An older file system supported by almost all operating systems and USB flash drives. However, it cannot handle individual files larger than 4 GB.
- NTFS (New Technology File System): The standard file system for modern Microsoft Windows. It supports massive file sizes, strong security permissions, and file compression.
- EXT4 (Extended File System 4): The standard journaling file system used in Linux and Android operating systems, known for high reliability and efficiency.
Key Components of File Systems:
- Files and Directories: Data is organized hierarchically into files (documents, images, code) and folders/directories.
- File Attributes: Metadata associated with files, such as file name, extension, size, creation date, owner, and read/write permissions.
- Allocation Methods: How disk blocks are assigned to files (Contiguous, Linked, or Indexed allocation).
Real-Life Example: Think of a massive library in a university. The books are the files, and the bookshelves, floors, and sections are the directories. The library catalog system (File System) tells you exactly on which shelf and row a specific book is stored so you can find it in seconds.
6. Deadlock Detection, Prevention, and Avoidance
One of the most fascinating and frustrating problems in operating systems is a Deadlock. A deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process in the set. None of them can move forward, and the system freezes up for those tasks.
The Four Necessary Conditions for Deadlock (Coffman Conditions):
- Mutual Exclusion: At least one resource must be held in a non-shareable mode (only one process can use it at a time).
- Hold and Wait: A process must be currently holding at least one resource while waiting to acquire other resources that are held by other processes.
- No Preemption: Resources cannot be forcibly taken away from a process; a resource can be released only voluntarily by the process holding it.
- Circular Wait: A closed chain of processes exists, where Process A waits for a resource held by Process B, Process B waits for Process C, and Process C waits for Process A.
Strategies to Handle Deadlocks:
- Deadlock Prevention: Designing the system in such a way that at least one of the four Coffman conditions can never occur (e.g., forcing processes to request all resources at once).
- Deadlock Avoidance: The OS examines resource requests dynamically using algorithms (like Dijkstra's famous Banker's Algorithm) to ensure the system never enters an "unsafe state" that could lead to a deadlock.
- Deadlock Detection and Recovery: Allowing deadlocks to happen occasionally, running a detection algorithm to spot them, and recovering by either terminating one of the deadlocked processes or rolling back their execution.
Real-Life Example: Imagine two cars facing each other on a narrow single-lane bridge in a mountainous area of northern Pakistan. Car A needs the right side of the bridge to move forward, but Car B is occupying it. Car B needs the left side, which Car A is occupying. Neither car can back up because there is traffic behind them. They are in a complete deadlock!
Key Terms & Easy Glossary
- Operating System (OS): A core system software that manages computer hardware, software resources, and provides common services for computer programs. It acts as the bridge between human users and the machine hardware.
- Process: A program that is currently loaded into RAM and being executed by the CPU. It contains its own program code, current activity, memory space, and system resources.
- Thread: The smallest unit of execution within a process. A single process can have multiple threads running concurrently, sharing the same memory space to perform tasks faster.
- Context Switching: The procedure of saving the current execution state of a running process so that the CPU can pause it, load another process, and resume it later without losing progress.
- CPU Scheduling: The method by which the operating system decides which process gets access to the CPU processor cores and for how long, ensuring smooth multitasking and efficiency.
- Virtual Memory: A memory management capability of an OS that uses secondary storage (like a hard disk or SSD) as an extension of physical RAM, allowing the computer to run large programs that exceed available RAM capacity.
- Paging: A memory management scheme that eliminates the need for contiguous allocation of physical RAM by dividing memory into fixed-size blocks called pages and frames.
- File System: The structural framework used by an operating system to organize, name, store, retrieve, and protect files on data storage devices like hard
Q: Define an operating system and list its primary goals and core functions in a computer system.
Easy Answer: An Operating System (OS) is a powerful system software program that acts as an essential bridge between computer hardware and the end-user. Without an OS, application programs like web browsers or word processors cannot run, because the hardware alone cannot understand high-level user commands. Think of the OS as the master conductor of an orchestra, ensuring that every hardware component (CPU, memory, storage devices, and input/output peripherals) works in perfect harmony with software requests.
Primary Goals of an Operating System:
- Convenience: To make computer hardware user-friendly and easy to interact with by providing graphical user interfaces (GUIs) or command-line interfaces.
- Efficiency: To ensure the computer's hardware resources (like CPU time and memory space) are utilized in the most optimal and productive manner possible.
- Resource Management: To fairly allocate hardware resources among multiple competing programs and users without conflicts.
Core Functions of an Operating System:
- Process Management: Creating, scheduling, suspending, and terminating processes (running programs) on the CPU.
- Memory Management: Tracking every byte of primary memory (RAM), allocating memory space to running programs, and reclaiming it when programs close.
- File System Management: Organizing data into logical units called files and directories on storage devices, and controlling read/write permissions.
- Device Management: Controlling hardware peripherals (printers, keyboards, monitors) using specialized software modules called device drivers.
- Security and Protection: Safeguarding system data and user files from unauthorized access through passwords, user accounts, and access control lists.
Example: When you save a Word document, the OS coordinates the CPU to process the save command, uses the file system to write data to the hard disk, and updates RAM accordingly.
Q: Distinguish between multiprocessing, multitasking, and multithreading paradigms.
Easy Answer: In computer science, multiprocessing, multitasking, and multithreading are fundamental execution paradigms designed to maximize system performance and efficiency, though they operate at different levels of the computer architecture.
1. Multiprocessing:
- Definition: The use of two or more physical Central Processing Units (CPUs) within a single computer system.
- Operation: The operating system distributes different tasks or processes across multiple processors simultaneously. This allows true parallel processing.
- Example: A modern quad-core laptop running a video editing software while simultaneously scanning for viruses on separate CPU cores.
2. Multitasking (Multiprogramming):
- Definition: The ability of an operating system to execute multiple tasks (processes) seemingly at the exact same time on a single CPU.
- Operation: The OS rapidly switches the CPU back and forth between different programs using time-slices. Because the switching happens in milliseconds, it creates an illusion of simultaneous execution.
- Example: Listening to music on a media player while typing a document and downloading a file on a single-core computer.
3. Multithreading:
- Definition: The ability of a single program or process to divide itself into two or more concurrently running sub-tasks called "threads."
- Operation: Threads within the same process share the same memory space and resources, making context-switching between threads much faster and lighter than switching between separate processes.
- Example: A web browser running one thread to download an image, another thread to render text, and a third thread to respond to mouse clicks.
Summary Table of Differences:
- Multiprocessing: Focuses on hardware (multiple CPUs).
- Multitasking: Focuses on running multiple independent programs.
- Multithreading: Focuses on breaking down a single program into smaller concurrent paths.
Q: Explain the concept of process states and the role of the Process Control Block (PCB).
Easy Answer: A process is a program in execution. During its lifetime, a process dynamically changes its status depending on its need for the CPU and other resources. These distinct stages are known as process states, while the operating system uses a dedicated data structure called the Process Control Block (PCB) to track everything about a process.
The Five Primary Process States:
- New: The process is currently being created or loaded into secondary storage and prepared for execution.
- Ready: The process has all necessary resources and is waiting patiently in the ready queue to be assigned to the CPU.
- Running: The CPU is actively executing the instructions of the process.
- Waiting (Blocked): The process cannot continue running because it is waiting for an external event to occur (such as user input or reading a file from a hard disk).
- Terminated (Zombie): The process has finished execution and its resources are being deallocated by the operating system.
The Role of the Process Control Block (PCB):
The PCB (also called a task control block) is like an identification card or a resume maintained by the operating system for every single process in the system. If a running process is paused, all its current details must be safely stored so it can resume later exactly where it left off.
Key Information Stored in a PCB:
- Process ID (PID): A unique number assigned to identify the process.
- Process State: Current status (Ready, Running, Waiting, etc.).
- CPU Registers: Saved values of accumulators, index registers, and stack pointers.
- CPU Scheduling Information: Process priority, pointers to scheduling queues, and time-slice values.
- Memory Management Information: Base and limit register values, page tables, or segment tables.
- I/O Status Information: A list of I/O devices allocated to the process and open file descriptors.
Q: Compare preemptive and non-preemptive CPU scheduling algorithms with suitable examples.
Easy Answer: CPU scheduling is the method by which the operating system decides which process gets control of the CPU next. Scheduling algorithms are broadly divided into two major categories: Preemptive and Non-Preemptive.
1. Non-Preemptive Scheduling:
- Definition: Once the CPU has been allocated to a process, the process keeps the CPU until it voluntarily releases it—either by terminating or by switching to a waiting state (for I/O operations).
- Characteristics: Simple to implement, low overhead, but can lead to long waiting times for short processes if a long process occupies the CPU first (known as the convoy effect).
- Example Algorithm: First-Come, First-Served (FCFS) without time limits.
- Real-World Analogy: A customer at a bank teller counter who stays there until every single one of their 10 transactions is completely finished, regardless of how many people are waiting behind them.
2. Preemptive Scheduling:
- Definition: The operating system has the authority to forcefully interrupt a currently running process and allocate the CPU to another process, even if the running process has not finished its task.
- Characteristics: Highly responsive, excellent for time-sharing systems, prevents any single process from monopolizing the CPU, but introduces complexity and context-switching overhead.
- Example Algorithm: Round Robin (RR), Shortest Remaining Time First (SRTF).
- Real-World Analogy: A doctor examining patients in a clinic where a patient with a life-threatening emergency can instantly interrupt a routine checkup.
Key Comparisons:
- Control: In non-preemptive, the process controls its own exit; in preemptive, the OS controls the CPU allocation.
- Fairness: Preemptive scheduling is fairer to short jobs, whereas non-preemptive can cause high turnaround times for quick tasks.
Q: Discuss the mechanism of virtual memory and how paging facilitates memory management.
Easy Answer: Virtual memory is a brilliant memory management technique implemented by operating systems that makes physical RAM appear much larger than it actually is. It allows execution of processes that may not be completely loaded into physical memory by temporarily transferring data between RAM and secondary storage (like an SSD or HDD).
How Virtual Memory Works:
- When a program is launched, only the actively needed parts are loaded into physical RAM. The rest remains stored on the hard disk in a designated area called swap space or page file.
- If the CPU requests an address that is currently not in RAM, a page fault occurs. The operating system pauses the process, fetches the required data from the disk into RAM, updates the memory tables, and resumes execution.
The Role of Paging in Memory Management:
Paging is the core mechanism that makes virtual memory possible. It eliminates the need for contiguous (side-by-side) memory allocation in RAM.
- Logical Memory (Pages): A program's virtual address space is broken down into fixed-size blocks called pages.
- Physical Memory (Frames): Physical RAM is also divided into fixed-size blocks of the exact same size called frames.
- Page Table: The OS maintains a page table for every process, acting as a map that translates virtual addresses (pages) into physical addresses (frames).
Example: If a game requires 8GB of RAM but your computer only has 4GB of physical RAM, paging allows the OS to seamlessly shuffle unused game levels onto the SSD and bring active levels into RAM without crashing the game.
Q: What is a deadlock? Explain the four necessary conditions for a deadlock to occur.
Easy Answer: A deadlock is a severe system state in concurrent computing where a set of processes are permanently blocked because each process is holding a resource and waiting for another resource acquired by some other process in the set. As a result, none of the processes can ever finish execution, and the system freezes or hangs.
Example: Process A holds Printer 1 and needs Scanner. Process B holds Scanner and needs Printer 1. Both wait forever for each other to release the resource.
According to research by computer scientist E.F. Codd and colleagues, a deadlock only occurs if all four of the following conditions happen simultaneously:
1. Mutual Exclusion:
- At least one resource must be held in a non-shareable mode. This means only one process can use the resource at any given time. If another process requests that resource, it must wait until it is released.
2. Hold and Wait:
- A process must be currently holding at least one resource while simultaneously waiting to acquire additional resources that are currently being held by other processes.
3. No Preemption:
- Resources cannot be forcibly snatched or taken away from a process. A resource can only be released voluntarily by the process holding it after that process has completed its task.
4. Circular Wait:
- A closed chain of processes must exist, such that Process $P_0$ is waiting for a resource held by $P_1$, $P_1$ is waiting for a resource held by $P_2$, and $P_n$ is waiting for a resource held by $P_0$.
Q: What is the primary role of system software compared to application software?
P: Easy Answer: System software serves as the foundational platform that manages computer hardware and provides a stable environment for running other programs. In contrast, application software is designed to perform specific, end-user tasks such as word processing, gaming, or web browsing. While application software interacts with the user and relies on system software to function, system software interacts directly with the physical hardware (CPUs, disks, memory) to keep the entire computer operational.
Q: Define the term 'Context Switch' in process management.
P: Easy Answer: A context switch is the computational procedure where the operating system stops running one process, saves its current execution state (stored in its Process Control Block), and loads the saved state of another process to resume its execution on the CPU. This rapid switching allows multi-tasking operating systems to give users the illusion that multiple programs are running simultaneously.
Q: What is throughput in the context of CPU scheduling?
P: Easy Answer: Throughput refers to the total number of processes that complete their execution per unit of time (e.g., processes completed per second). In CPU scheduling, higher throughput is a key performance indicator because it means the system is efficiently utilizing its CPU to finish jobs quickly and keep productivity high.
Q: Explain the concept of Thrashing in virtual memory systems.
P: Easy Answer: Thrashing is a degenerate condition in a virtual memory system where the computer spends more time swapping pages in and out of physical RAM than it does actually executing software instructions. This usually occurs when physical memory is overcommitted, causing constant page faults, system slowdowns, and unresponsiveness.
Q: What are the main responsibilities of the File System Manager?
P: Easy Answer: The File System Manager is an OS subsystem responsible for organizing, storing, retrieving, naming, and protecting data files on storage devices. Its main responsibilities include managing disk space allocation, maintaining directory structures, enforcing file access permissions, and translating logical file requests into physical disk block operations.
Q: State the difference between logical address and physical address.
P: Easy Answer: A logical address (virtual address) is generated by the CPU and represents the memory location seen by an application program. A physical address refers to the actual, physical location of data stored inside the hardware RAM memory chips. The Memory Management Unit (MMU) translates logical addresses into physical addresses.
Q: Define semaphore and its usage in process synchronization.
P: Easy Answer: A semaphore is an integer variable used as a synchronization tool in operating systems to control access to shared resources in a concurrent environment. It uses two atomic operations, usually called `wait()` (down) and `signal()` (up), to prevent race conditions and ensure safe mutual exclusion among competing processes.
Q: What is mutual exclusion in concurrent programming?
P: Easy Answer: Mutual exclusion is a concurrency control property ensuring that when one process is executing inside its critical section (accessing a shared resource like a file or printer), no other process can enter its critical section for that same resource. This prevents data corruption caused by simultaneous read/write operations.
Q: List the strategies used for deadlock recovery.
P: Easy Answer: When a deadlock is detected, the operating system can recover using several strategies: 1. Process Termination: Aborting all deadlocked processes or aborting them one by one until the deadlock cycle is broken. 2. Resource Preemption: Forcibly taking resources away from certain processes and giving them to others. 3. Checkpointing/Rollback: Rolling back a process to a previously saved safe state and restarting it later.
Q: What is the function of a device driver in an operating system?
P: Easy Answer: A device driver is a specialized system software component that acts as a translator or mediator between the operating system and hardware devices (such as printers, graphics cards, or mice). It allows the OS to send standardized commands to hardware without needing to know the complex, device-specific physical details.
Long Question: Provide a detailed classification of operating systems, explaining batch, time-sharing, distributed, and real-time operating systems with real-world applications.
Simple Introduction & Definition
An Operating System (OS) acts as the foundational bridge between computer hardware and the human user. Think of the OS as the manager of a large, busy hotel. The hotel has rooms (memory), staff (CPU), guests (applications), and luggage handlers (storage devices). Without the manager to coordinate who goes where and when, complete chaos would break out, and nothing would get done efficiently. In computer science, an operating system performs this exact managerial role. It allocates resources, manages security, handles input/output operations, and controls the execution of all software programs. Over the decades, computers have evolved rapidly from room-sized calculating machines to tiny smartphones in our pockets. Because hardware capabilities and user demands have changed so dramatically, operating systems have also evolved into several specialized classifications. Understanding these types of operating systems helps computer scientists choose the right architecture for everything from simple household appliances to massive global cloud computing infrastructures.
1. What is a Batch Operating System?
- Definition: The earliest form of operating system where jobs with similar needs were grouped together and executed sequentially without user interaction during execution.
- How it works: Users prepared their jobs on punch cards, submitted them to the computer operator, and waited hours or days for results.
- Key Characteristic: Lack of interaction between the user and the running job once it was submitted.
2. Real-World Applications of Batch Systems
- Payroll Processing: Large companies calculating monthly salaries, taxes, and deductions for thousands of employees all at once at the end of the month.
- Bank Statement Generation: Processing daily transaction logs overnight to print and mail customer bank statements.
- Scientific Calculations: Running massive weather simulations or statistical analysis jobs that take hours to compute.
3. What is a Time-Sharing (Multitasking) Operating System?
- Definition: An OS that allows multiple users to share system resources simultaneously by switching the CPU rapidly between different tasks.
- How it works: The CPU allocates a very short time slice (quantum) to each user program, switching between them so fast that it creates an illusion of simultaneous execution.
- Key Characteristic: High interactivity and responsiveness, allowing multiple humans to work on terminals connected to a single mainframe.
4. Real-World Applications of Time-Sharing Systems
- University Mainframe Labs: Dozens of students writing code on separate terminals connected to one central university server.
- Modern Desktop OS (Windows/macOS): Users running a web browser, typing a document in Word, and listening to music all at the same time.
- Cloud Virtual Machines: Multiple tenants renting slices of computing power on Amazon AWS or Microsoft Azure.
5. What is a Distributed Operating System?
- Definition: An operating system that manages a group of independent computers and makes them appear to the end user as a single, coherent computer system.
- How it works: Communication takes place over a shared network. Tasks are distributed across multiple physical machines to balance the workload.
- Key Characteristic: Fault tolerance and resource sharing; if one node fails, another node can often take over its responsibilities.
6. Real-World Applications of Distributed Systems
- World Wide Web / Google Search: Millions of servers working together across the globe to index web pages and return search results in milliseconds.
- Online Banking Networks: Global banking systems coordinating transactions across servers in New York, London, and Tokyo.
- Cluster Computing in Research: Combining thousands of home PCs or server blades to analyze particle physics data at CERN.
7. What is a Real-Time Operating System (RTOS)?
- Definition: A specialized operating system designed to serve applications with strict, fixed time constraints where data processing must occur within an exact, guaranteed timeframe.
- How it works: Priority-based scheduling ensures that critical tasks always interrupt less important background tasks instantly.
- Key Characteristic: Predictability and absolute reliability; a correct answer delivered too late is considered a complete system failure.
8. Real-World Applications of Real-Time Systems (Hard vs. Soft)
- Air Traffic Control Systems: Hard RTOS tracking aircraft positions to prevent mid-air collisions; missing a deadline could be catastrophic.
- Automotive Airbag Deployment: Sensors detecting a crash and firing the airbag within milliseconds.
- Streaming Video Players (Soft RTOS): Dropping a frame occasionally if the network lags, which causes minor visual stutter but not system failure.
9. Advantages and Disadvantages of Batch Systems
- Pros: Handled heavy workloads efficiently without human idle time; great for repetitive, large-scale data processing.
- Cons: CPU often sat idle while waiting for mechanical I/O devices; debugging was extremely tedious since users couldn't interact with running programs.
10. Advantages and Disadvantages of Time-Sharing Systems
- Pros: Reduced CPU idle time; allowed multiple users to interact directly with their programs simultaneously.
- Cons: Required complex memory management, security protocols, and CPU scheduling to prevent users from crashing each other's programs.
11. Advantages and Disadvantages of Distributed Systems
- Pros: High scalability, excellent reliability, and efficient sharing of costly hardware resources like high-performance printers and databases.
- Cons: High setup and maintenance complexity; heavily reliant on network stability and robust security measures.
12. Advantages and Disadvantages of Real-Time Systems
- Pros: Absolute predictability, flawless execution of life-critical missions, and maximum efficiency in specialized embedded hardware.
- Cons: Highly complex programming, expensive development costs, and limited multitasking capability outside of priority-driven tasks.
Easy Summary / Exam Conclusion
In summary, operating systems are classified based on how they manage hardware resources and interact with users. Batch operating systems paved the way by automating repetitive data processing without user intervention. Time-sharing systems revolutionized computing by introducing interactivity and multitasking, allowing multiple users to share a single powerful machine. Distributed operating systems expanded this concept across networks, linking thousands of computers into seamless, fault-tolerant global networks. Finally, real-time operating systems mastered time itself, ensuring strict, predictable execution for critical embedded applications like medical devices and aviation controls. Recognizing these distinctions enables software engineers to select the exact OS architecture required for any given technological challenge, from simple household microwaves to planetary-scale cloud computing hubs.
Long Question: Analyze and compare First-Come, First-Served (FCFS), Shortest Job First (SJF), and Round Robin CPU scheduling algorithms with numerical turnaround time calculations.
Simple Introduction & Definition
Inside every computer's CPU, multiple programs and processes compete for processing time. Because a standard CPU can only execute one instruction stream at a time (per core), the operating system must use a CPU scheduling algorithm to decide which process gets the processor and for how long. Imagine a single checkout counter at a busy grocery store. If the cashier handles customers randomly, people get frustrated. Instead, store managers use specific queueing rules—such as serving people in the order they arrive, serving people with the fewest items first, or giving everyone equal fixed turns at the counter. In operating systems, CPU scheduling algorithms manage the ready queue to maximize CPU utilization, throughput, and fairness while minimizing waiting time and turnaround time. To understand how these algorithms work in practice, we must examine their mechanics, advantages, disadvantages, and numerical behavior.
1. Understanding CPU Scheduling Concepts
- Arrival Time ($AT$): The exact moment a process enters the ready queue waiting for CPU execution.
- Burst Time ($BT$): The total amount of CPU time required by a process to complete its execution.
- Completion Time ($CT$): The time at which a process finishes its execution.
- Turnaround Time ($TAT$): The total time taken from the moment a process arrives to the moment it finishes ($TAT = CT - AT$).
- Waiting Time ($WT$): The total time a process spends waiting in the ready queue ($WT = TAT - BT$).
2. First-Come, First-Served (FCFS) Scheduling
- Definition: A non-preemptive scheduling algorithm where the process that arrives first in the ready queue gets executed first.
- How it works: Operates strictly like a standard queue at a ticket counter (FIFO: First In, First Out).
- Key Characteristic: Simple to implement using a FIFO queue, but suffers from the "Convoy Effect" where small processes wait behind a massive CPU-bound process.
3. Numerical Example for FCFS
- Processes: Let us consider three processes with Arrival Times ($AT$) and Burst Times ($BT$):
- $P1$: $AT = 0$, $BT = 24$
- $P2$: $AT = 1$, $BT = 3$
- $P3$: $AT = 2$, $BT = 3$
- Execution Timeline:
- $P1$ runs from $0$ to $24$ ($CT = 24$).
- $P2$ runs from $24$ to $27$ ($CT = 27$).
- $P3$ runs from $27$ to $30$ ($CT = 30$).
- Turnaround Times ($TAT = CT - AT$):
- $P1$: $24 - 0 = 24$
- $P2$: $27 - 1 = 26$
- $P3$: $30 - 2 = 28$
- Average Turnaround Time: $(24 + 26 + 28) / 3 = 78 / 3 = 26$ time units.
4. Shortest Job First (SJF) Scheduling
- Definition: A scheduling policy that selects the waiting process with the smallest total CPU burst time for execution.
- How it works: Can be non-preemptive (once a process starts, it runs to completion) or preemptive (Shortest Remaining Time First - SRTF).
- Key Characteristic: Mathematically proven to give the minimum average waiting time for a given set of processes.
5. Numerical Example for Non-Preemptive SJF
- Processes: Same set ($P1: AT=0, BT=24$; $P2: AT=1, BT=3$; $P3: AT=2, BT=3$).
- Execution Timeline:
- At $t=0$, only $P1$ has arrived. $P1$ runs from $0$ to $24$.
- At $t=24$, all processes ($P1, P2, P3$) have arrived. SJF checks remaining burst times: $P2$ ($BT=3$) and $P3$ ($BT=3$).
- $P2$ runs from $24$ to $27$ ($CT = 27$).
- $P3$ runs from $27$ to $30$ ($CT = 30$).
- Turnaround Times:
- $P1$: $24 - 0 = 24$
- $P2$: $27 - 1 = 26$
- $P3$: $30 - 2 = 28$
- Average Turnaround Time: $(24 + 26 + 28) / 3 = 26$ time units (in this specific arrival sequence, identical to FCFS, but let's test simultaneous arrival to see true power).
6. SJF Simultaneous Arrival Example
- Processes: $P1 (BT=6)$, $P2 (BT=8)$, $P3 (BT=7)$, $P4 (BT=3)$ all arrive at $t=0$.
- FCFS Order: $P1 \rightarrow P2 \rightarrow P3 \rightarrow P4$ yields average waiting time of $10.25$ units.
- SJF Order: Sort by burst time: $P4 (3) \rightarrow P1 (6) \rightarrow P3 (7) \rightarrow P2 (8)$.
- Waiting Times: $P4=0$, $P1=3$, $P3=9$, $P2=16$. Average Waiting Time = $(0 + 3 + 9 + 16) / 4 = 7$ units (vastly superior!).
7. Round Robin (RR) Scheduling
- Definition: A preemptive scheduling algorithm designed especially for time-sharing systems, where each process is assigned a fixed CPU time slice (quantum, e.g., $q = 4$).
- How it works: The CPU cycles through the ready queue, allocating the CPU to each process for at most one time quantum. If the process does not finish, it is preempted and sent to the back of the ready queue.
- Key Characteristic: Highly fair; prevents starvation and ensures good response time for interactive users.
8. Numerical Example for Round Robin
- Processes & Burst Times (Assume all arrive at $t=0$): $P1 (BT=24)$, $P2 (BT=3)$, $P3 (BT=3)$, Time Quantum ($q = 4$).
- Execution Timeline:
- $P1$ runs from $0$ to $4$ (Remaining $BT = 20$).
- $P2$ runs from $4$ to $7$ ($P2$ finishes! $CT = 7$).
- $P3$ runs from $7$ to $10$ ($P3$ finishes! $CT = 10$).
- $P1$ runs in chunks of $4$ until it finishes at $t = 30$ ($CT = 30$).
- Completion Times: $P1 = 30$, $P2 = 7$, $P3 = 10$.
- Turnaround Times ($AT = 0$): $P1 = 30$, $P2 = 7$, $P3 = 10$.
- Average Turnaround Time: $(30 + 7 + 10) / 3 = 47 / 3 = 15.66$ units (significantly better than FCFS and SJF in this scenario!).
9. Comparing FCFS, SJF, and Round Robin
- Fairness: RR is fairest to all processes; FCFS and SJF can starve long jobs if short jobs keep arriving.
- Overhead: FCFS has minimal overhead; SJF requires knowing or predicting future burst times; RR requires timer interrupts and context switching overhead.
- Response Time: RR provides exceptional interactive response time, whereas FCFS and SJF can leave users waiting behind long batch jobs.
10. The Challenge of Predicting Burst Time in SJF
- The Problem: Operating systems cannot know in advance how much CPU time a process will require before it executes.
- The Solution: Systems use exponential smoothing based on past CPU bursts to estimate the next CPU burst time ($T_{n+1} = \alpha t_n + (1-\alpha)T_n$).
11. Impact of Time Quantum Selection in Round Robin
- Large Quantum: If quantum is too large, Round Robin degrades into simple FCFS.
- Small Quantum: If quantum is too small (e.g., $1$ms), the CPU spends more time switching context (saving and loading registers) than executing actual user code, causing severe performance degradation ("thrashing" of CPU).
12. Practical Selection Guide for Operating Systems
- Batch Systems: FCFS or non-preemptive SJF works well because interactive response time is not a priority.
- Interactive Desktop / Servers: Round Robin (or multi-level feedback queues) is mandatory to guarantee smooth user experience and prevent system freezes.
Easy Summary / Exam Conclusion
CPU scheduling algorithms are the beating heart of operating system multitasking. First-Come, First-Served (FCFS) offers simplicity but suffers from the convoy effect, penalizing shorter processes behind heavy workloads. Shortest Job First (SJF) achieves optimal average waiting times by prioritizing smaller tasks, but it is practically difficult to implement due to the challenge of predicting future burst times. Round Robin (RR) introduces time slicing and preemption, making it the gold standard for interactive time-sharing systems by ensuring fairness and responsiveness, provided the time quantum is tuned correctly. Through numerical analysis of turnaround times and completion metrics, computer scientists can mathematically evaluate these algorithms and select the optimal scheduling strategy for specific computing environments.
Long Question: Examine memory management techniques in detail, focusing on continuous allocation, segmentation, and paging mechanisms along with page replacement algorithms.
Simple Introduction & Definition
The computer’s physical main memory (RAM) is a precious, limited resource shared by the operating system and all running software applications. Imagine a large warehouse divided into storage bays. Every box (data or instruction) that arrives must be stored securely so warehouse workers (the CPU) can retrieve it instantly. If items are scattered carelessly, valuable space is wasted, and workers spend too much time searching. Memory management is the operating system's mechanism for tracking every byte of main memory, allocating space to processes when they launch, and reclaiming that space when they terminate. Without robust memory management, modern multitasking computers would crash instantly due to memory corruption or exhaustion. To achieve efficient utilization, operating systems have evolved from basic continuous allocation schemes to advanced virtual memory techniques like segmentation, paging, and intelligent page replacement algorithms.
1. What is Continuous Memory Allocation?
- Definition: A memory management scheme where each process is loaded into a single, continuous block of physical RAM.
- How it works: The OS divides memory into fixed or variable-sized partitions. When a process requests memory, a contiguous block is found and assigned to it.
- Key Characteristic: Simple to manage using base and limit registers for memory protection, but prone to severe memory fragmentation.
2. Understanding Memory Fragmentation
- External Fragmentation: Total free memory space is enough to satisfy a request, but it is divided into small, non-contiguous blocks scattered across RAM.
- Internal Fragmentation: Memory allocated to a process is slightly larger than requested memory; the unused space inside the partition is wasted.
- Compaction: A technique where the OS pauses all processes and shifts them around in RAM to group all free memory into one large contiguous block.
3. What is Segmentation?
- Definition: A memory management technique that supports the user's view of memory by dividing a program into logical modules or segments (e.g., code, data, stack, heap).
- How it works: Each segment has a name and a length. A segment table maps logical addresses (segment number + offset) to physical memory addresses.
- Key Characteristic: Perfectly aligns with how programmers write code, but leads to complex memory allocation and external fragmentation issues.
4. What is Paging?
- Definition: A memory management scheme that eliminates external fragmentation by dividing physical memory into fixed-size blocks called frames and logical memory into blocks of the same size called pages.
- How it works: Logical pages of a process can be loaded into any available physical frames anywhere in RAM, guided by a Page Table.
- Key Characteristic: Completely solves external fragmentation and enables powerful Virtual Memory architectures.
5. The Role of the Page Table and MMU
- Memory Management Unit (MMU): A hardware component that translates logical virtual addresses generated by the CPU into physical RAM addresses using the Page Table.
- Address Translation: A logical address is split into a Page Number ($p$) and an Offset ($d$). The MMU looks up $p$ in the Page Table to find physical frame number $f$, combining $f$ with offset $d$ to access physical RAM.
- TLB (Translation Lookaside Buffer): A high-speed hardware cache used by the MMU to store recent page-to-frame translations, drastically speeding up memory access.
6. What is Virtual Memory and Demand Paging?
- Virtual Memory: A technique that allows the execution of processes that may not be completely loaded in physical RAM by utilizing secondary storage (HDD/SSD) as an extension of memory.
- Demand Paging: Pages are loaded into RAM only when they are explicitly demanded by the CPU execution stream, rather than loading the entire program upfront.
- Page Fault: An interrupt triggered by hardware when the CPU tries to access a page that is currently valid in virtual memory but not currently loaded in physical RAM frames.
7. Page Replacement Algorithms: First-In, First-Out (FIFO)
- Definition: The simplest page replacement algorithm where the OS keeps track of all pages in memory in a queue, replacing the oldest page when a page fault occurs.
- How it works: The page that has been in RAM the longest is evicted first.
- Key Characteristic: Extremely easy to program, but suffers from "Belady's Anomaly," where increasing the number of physical frames paradoxically causes *more* page faults.
8. Page Replacement Algorithms: Optimal (OPT / MIN)
- Definition: The theoretical page replacement algorithm that replaces the page that will not be used for the longest period of time in the future.
- How it works: Looks forward into the execution reference string to make the absolute best eviction decision.
- Key Characteristic: Yields the absolute lowest possible page fault rate, but is completely impossible to implement in real operating systems because future CPU references cannot be known in advance.
9. Page Replacement Algorithms: Least Recently Used (LRU)
- Definition: A practical page replacement algorithm that replaces the page that has not been referenced for the longest time in the past.
- How it works: Based on the principle of locality: programs tend to access data that they accessed recently.
- Key Characteristic: Highly efficient and widely used in real operating systems, closely approximating Optimal performance without requiring future knowledge.
10. Numerical Comparison of FIFO vs LRU
- Reference String: Consider page requests: $7, 0, 1, 2, 0, 3, 0, 4, 2, 3$ with $3$ physical frames.
- FIFO Result: Results in $15$ page faults because it blindly evicts pages based purely on arrival time, regardless of whether a page is about to be used again immediately.
- LRU Result: Results in $12$ page faults because it retains recently accessed pages (like $0$ and $2$), avoiding unnecessary page faults.
11. What is Thrashing?
- Definition: A state of severe performance degradation where the computer spends more time swapping pages in and out of secondary storage than executing actual application instructions.
- Cause: Occurs when the operating system has allocated too few frames to active processes, leading to constant page faults.
- Solution: Implement Working Set models or increase physical RAM to give processes the frames they genuinely require.
12. Summary of Memory Management Evolution
- Continuous Allocation: Outdated, fragment-prone.
- Segmentation: Excellent for logical program structure.
- Paging & Virtual Memory: Modern standard; eliminates fragmentation, allows massive programs to run on modest RAM through disk swapping.
Easy Summary / Exam Conclusion
Memory management is a cornerstone of operating system design, transforming physical RAM into an efficient, secure, and seemingly infinite resource for applications. Continuous allocation laid the foundational framework but suffered from severe fragmentation issues. Segmentation introduced logical modularity matching programmer intuition, while paging solved external fragmentation entirely by dividing memory into fixed-size frames and pages. Combined with virtual memory and demand paging, operating systems can run programs much larger than physical RAM. Finally, page replacement algorithms like FIFO, Optimal, and LRU govern how pages are swapped in and out of memory during page faults, balancing hardware constraints with application performance. Mastery of these memory architectures is essential for designing high-performance computing systems.
Long Question: Critically evaluate deadlock handling techniques, differentiating between deadlock prevention, avoidance (Banker's Algorithm), and detection strategies.
Simple Introduction & Definition
Imagine two cars driving down a narrow, single-lane bridge from opposite directions. They meet right in the middle. Neither car can move forward because the other is blocking the path, and neither car can back up because there are vehicles behind them. This stalemate is a real-world deadlock. In computer science and operating systems, a deadlock is a permanent state of blockage where a set of processes are permanently blocked because each process holds a resource and is waiting for another resource acquired by another process in the set. For example, Process A holds Printer $1$ and waits for Scanner $2$, while Process B holds Scanner $2$ and waits for Printer $1$. Both processes freeze forever, consuming system resources without making any progress. To prevent system crashes, operating systems employ sophisticated deadlock handling techniques: Prevention, Avoidance, Detection, and Recovery. Evaluating these strategies reveals how operating systems maintain stability in multi-process environments.
1. The Four Necessary Conditions for Deadlock
- Mutual Exclusion: At least one resource must be held in a non-shareable mode; only one process can use the resource at any given time.
- Hold and Wait: A process must be currently holding at least one resource while actively waiting to acquire additional resources held by other processes.
- No Preemption: Resources cannot be forcibly snatched from a process; a resource can be released only voluntarily by the process holding it after task completion.
- Circular Wait: A closed chain of processes exists, where Process $P0$ waits for a resource held by $P1$, $P1$ waits for $P2$, and $Pn$ waits for $P0$.
2. Strategy 1: Deadlock Prevention
- Definition: A set of methods designed to ensure that at least one of the four necessary conditions for deadlock can *never* hold true, thereby making deadlocks mathematically impossible.
- How it works: The operating system enforces rigid architectural rules on how processes request and acquire resources.
- Key Characteristic: Highly proactive, but often results in very low resource utilization and reduced system throughput.
3. Preventing Mutual Exclusion and Hold & Wait
- Attacking Mutual Exclusion: Make resources shareable (e.g., using spooling for printers so multiple jobs can write to disk). Limitation: Some resources (like a write-locked database record or a tape drive) can never be shared.
- Attacking Hold & Wait: Require a process to request and be allocated *all* its required resources simultaneously before it begins execution. Limitation: Extremely inefficient; resources sit idle while waiting for a rare resource to become available.
4. Preventing No Preemption and Circular Wait
- Attacking No Preemption: If a process holding certain resources requests another resource that cannot be immediately allocated to it, the OS preempts all its currently held resources, forcing it to restart later.
- Attacking Circular Wait: Impose a strict total ordering on all resource types. Assign each resource a numerical ID (e.g., Printer = $1$, Scanner = $2$, Disk = $3$). Processes must request resources in strictly increasing numerical order. This makes circular wait impossible!
5. Strategy 2: Deadlock Avoidance (Banker's Algorithm)
- Definition: A dynamic resource allocation strategy where the operating system inspects resource requests in advance to ensure the system never enters an "unsafe" state.
- How it works: The OS requires processes to declare their maximum potential resource needs upfront. When a request is made, the OS simulates granting it. If the resulting state is safe (meaning there is at least one safe execution sequence where all processes can finish), the request is granted. If unsafe, the process must wait.
- Key Characteristic: Avoids the rigid restrictions of prevention, but requires advance knowledge of maximum resource demands, which is rarely known in practice.
6. Understanding Safe vs. Unsafe States in Banker's Algorithm
- Safe State: A state where the OS can allocate resources to each process in some specific order (Safe Sequence) without resulting in a deadlock.
- Unsafe State: Not a deadlock yet, but a state from which the operating system can no longer prevent processes from requesting more resources and triggering a deadlock.
- Analogy: Like a bank manager (hence "Banker's Algorithm") who has a limited pool of cash. As long as the bank can satisfy customers' maximum credit limits one by one as they finish, the bank is in a safe financial state.
7. Strategy 3: Deadlock Detection
- Definition: A reactive strategy where the operating system does not restrict resource requests or prevent conditions. Instead, it periodically runs background algorithms to inspect resource allocation graphs and check if a deadlock has actually occurred.
- How it works: Maintains a Wait-For Graph (for single instances of resources) or Resource Allocation matrices (for multiple instances, similar to Banker's Algorithm) to search for cycles.
- Key Characteristic: Maximizes resource utilization and flexibility, but incurs continuous CPU overhead for running detection algorithms.
8. Deadlock Recovery Strategies
- Process Termination: The OS kills one or more deadlocked processes to break the circular wait. Can kill all deadlocked processes (expensive) or kill them one by one until the deadlock cycle is broken.
- Resource Preemption: The OS forcibly takes away resources from one or more processes, rolling them back to a safe checkpoint, and reassigning them to break the deadlock.
9. Comparison Table: Prevention vs. Avoidance vs. Detection
- Prevention: Structural design rules; breaks the 4 conditions; low resource utilization; zero runtime overhead.
- Avoidance: Dynamic checking; ensures system stays in safe states; requires max resource claims; moderate overhead.
- Detection: Periodic inspection; allows deadlocks to occur and cleans them up; high flexibility; recovery overhead.
10. Practical Real-World Challenges in Deadlock Handling
- Unpredictable Workloads: Modern interactive software cannot reliably predict its maximum future resource requirements upfront, rendering Banker's Algorithm difficult to implement in standard desktop OSs.
- Performance Trade-offs: Constantly running deadlock detection algorithms on high-speed transaction databases can slow down system throughput.
11. Deadlock vs. Starvation
- Deadlock: Permanent blockage where a group of processes wait indefinitely for each other's resources with no progress.
- Starvation: A situation where a process is indefinitely denied necessary CPU or resource time because other higher-priority processes keep jumping ahead of it (solved using "aging").
12. Conclusion on Deadlock Management
- Most general-purpose operating systems (like Windows, Linux, and macOS) choose not to use prevention or avoidance because they restrict performance. Instead, they ignore deadlocks entirely (the "Ostrich Algorithm"), assuming they happen so rarely that manual rebooting or application termination is cheaper than constant runtime checking!
Easy Summary / Exam Conclusion
Deadlock handling is a critical aspect of operating system design, ensuring that multi-threaded and multi-process applications do not freeze in permanent stalemates. The four necessary conditions—Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait—must all be present for a deadlock to occur. Operating systems combat deadlocks through three primary strategies: Deadlock Prevention (enforcing structural rules to eliminate conditions), Deadlock Avoidance (using algorithms like the Banker's Algorithm to dynamically inspect safe states before granting resources), and Deadlock Detection (allowing deadlocks to occur and running algorithms to detect and recover from them). While prevention and avoidance offer theoretical safety at the cost of resource efficiency, many modern operating systems rely on detection, recovery, or even graceful ignorance, balancing system throughput with architectural complexity.
MCQ #1 What is the primary role of an operating system?
MCQ #2 Which of the following represents the state where a process is currently receiving CPU execution time?
MCQ #3 What is a lightweight process within a process called?
MCQ #4 Which CPU scheduling algorithm allocates the CPU to processes in the order they arrive in the ready queue?
MCQ #5 Which CPU scheduling algorithm assigns a fixed time slice (quantum) to each process?
MCQ #6 What technique allows the execution of processes that may not be completely loaded in main memory?
MCQ #7 In memory management, what is the fixed-size block of logical memory called?
MCQ #8 What phenomenon occurs when a system spends more time paging than executing actual instructions?
MCQ #9 Which of the following is NOT a necessary condition for a deadlock to occur?
MCQ #10 Which method deals with deadlocks by ensuring the system never enters an unsafe state?
MCQ #11 What data structure is commonly used by the operating system to keep track of all open files?
MCQ #12 What is the term for the situation where a low-priority process is indefinitely denied CPU time?
MCQ #13 Which disk scheduling algorithm moves the disk arm across the disk in one direction, servicing requests, and then returns immediately to the other end?
MCQ #14 What is the primary function of a Process Control Block (PCB)?
MCQ #15 Which memory allocation method suffers from external fragmentation?