Second Half Flashcards
What is the primary function of the I/O subsystem in an OS?
To manage communication between the computer and external devices.
What are the types of I/O devices?
Input devices (e.g., keyboard, mouse), output devices (e.g., monitor, printer), and storage devices (e.g., hard drives).
What is the purpose of device drivers in I/O management?
To act as an interface between the operating system and hardware devices.
What is direct memory access (DMA)?
A feature allowing devices to transfer data directly to/from memory without CPU intervention.
How does the OS manage multiple I/O requests?
By using I/O scheduling algorithms to optimize device usage.
What is buffering in I/O systems?
Temporarily storing data in memory during I/O operations to improve performance.
What is spooling in I/O?
A technique for managing output devices by storing jobs in a queue until the device is ready.
What is the role of an I/O scheduler?
To decide the order in which I/O requests are processed to optimize system performance.
What is the difference between synchronous and asynchronous I/O?
Synchronous I/O waits for operations to complete, while asynchronous I/O allows processes to continue executing.
How does the OS ensure fairness in I/O management?
By using priority-based or round-robin scheduling for I/O requests.
What is a file in the context of an operating system?
A collection of related data stored on secondary storage, identified by a name.
What are the main operations supported by a file system?
Creation, deletion, reading, writing, and updating files.
What is a directory in a file system?
A structure that organizes and manages files within a storage device.
What are file attributes?
Metadata about a file, such as name, type, size, creation date, and permissions.
What is file allocation?
The method by which disk space is assigned to files (e.g., contiguous, linked, or indexed).
How does the OS ensure file security?
By implementing access control lists (ACLs) and file permissions.
What is a file descriptor?
A reference to an open file used by the OS to manage file operations.
What is the purpose of a file system hierarchy?
To organize files and directories in a structured manner for easy navigation.
What is journaling in file systems?
A technique to keep track of changes in a log to prevent data loss during system crashes.
What are examples of file systems?
FAT32, NTFS, ext4, HFS+, and APFS.
What is disk scheduling in operating systems?
A technique to optimize the order of disk I/O requests to improve performance.
What is the First-Come, First-Served (FCFS) disk scheduling algorithm?
A simple method where requests are processed in the order they arrive.
What is the Shortest Seek Time First (SSTF) algorithm?
A scheduling method that selects the request closest to the current disk head position.
What is the SCAN (Elevator) disk scheduling algorithm?
It moves the disk head back and forth across the disk to service requests.
What is the C-SCAN algorithm?
A variant of SCAN that services requests in one direction and quickly returns to the start.
What is disk fragmentation?
A condition where files are scattered across non-contiguous areas of the disk.
What is defragmentation?
The process of reorganizing disk contents to store files in contiguous blocks.
What is RAID in disk management?
A technology for combining multiple disks to improve performance and redundancy.
What are the types of RAID configurations?
RAID 0 (striping), RAID 1 (mirroring), RAID 5 (striping with parity), and more.
What is the role of a disk cache?
To temporarily store frequently accessed data to improve read and write speeds.
What is the goal of CPU scheduling algorithms?
To optimize CPU utilization, response time, throughput, and fairness.
What is the Round Robin (RR) scheduling algorithm?
A pre-emptive algorithm that allocates CPU time in fixed time slices or quantums.
What is the Shortest Job Next (SJN) algorithm?
A non-pre-emptive algorithm that selects the process with the shortest CPU burst time.
How does the Multi-Level Feedback Queue (MLFQ) work?
It uses multiple queues with different priorities, allowing processes to move between queues based on execution history.
What is the Highest Response Ratio Next (HRRN) algorithm?
A non-pre-emptive algorithm that considers both waiting time and burst time to calculate process priority.
What is starvation in scheduling?
When a process never gets CPU access due to constant selection of higher-priority processes.
How does aging prevent starvation?
By gradually increasing the priority of processes that have waited too long.
What is the difference between CPU-bound and I/O-bound processes?
CPU-bound processes spend more time on computation, while I/O-bound processes spend more time waiting for I/O operations.
What is the difference between static and dynamic priority scheduling?
Static assigns fixed priorities, while dynamic adjusts priorities based on factors like aging or process behavior.
How are scheduling algorithms evaluated?
Using metrics like average wait time, turnaround time, and throughput.
What is synchronization in the context of concurrency?
Ensuring that processes execute in a coordinated manner to avoid conflicts when accessing shared resources.
What is a race condition?
A situation where the system’s behavior depends on the sequence or timing of uncontrollable events, leading to unpredictable outcomes.
What are semaphores used for?
To control access to shared resources by processes, preventing simultaneous access that could cause conflicts.
What is a mutex?
A mutual exclusion lock that allows only one thread or process to access a resource at a time.
What is a critical section?
A portion of a program that accesses shared resources and must not be executed by more than one process at a time.
What are the conditions necessary for a deadlock to occur?
Mutual exclusion, hold and wait, no preemption, and circular wait.
How can deadlocks be prevented?
By breaking one or more of the necessary conditions, such as avoiding circular wait or allowing resource preemption.
What is deadlock detection?
Monitoring resource allocation to identify and resolve deadlocks when they occur.
What is the dining philosophers problem?
A classic synchronization problem demonstrating the challenges of allocating resources without causing deadlocks.
What is the banker’s algorithm?
A deadlock-avoidance algorithm that dynamically allocates resources while ensuring system safety.
What is the purpose of CPU scheduling simulations?
To evaluate and compare the performance of different scheduling algorithms.
What is the first step in running a scheduling simulation?
Calculate the total service units and create a grid to track processes.
How are processes ranked in simulations for non-pre-emptive algorithms?
Based on criteria like arrival time or burst time.
How does Round Robin scheduling handle time slices in simulations?
Each process gets a fixed quantum, and the queue is updated after every time slice.
What is Normalized Turnaround Time (NTT)?
A ratio of turnaround time to service burst time, used to measure the fairness of an algorithm.
How is wait time calculated in simulations?
By summing the time spent waiting for the CPU between arrival and execution.
What does the turnaround time represent in simulations?
The total time a process spends in the system, from arrival to completion.
Why is NTT important in evaluating scheduling algorithms?
It normalizes turnaround time, accounting for the process’s burst length.
What are the benefits of running simulations for scheduling?
To analyze algorithm efficiency and identify bottlenecks in CPU usage.
How are pre-emptive algorithms simulated differently?
The CPU becomes available based on time limits or new process arrivals, requiring frequent re-ranking.
What is the difference between Shortest Process Next (SPN) and Shortest Remaining Time (SRT)?
SPN is non-pre-emptive, while SRT is a pre-emptive scheduling algorithm.
How does the Multi-Level Feedback Queue (MLFQ) algorithm prioritize processes?
By dynamically adjusting process priority based on execution history and wait time.
What is the primary goal of the Highest Response Ratio Next (HRRN) algorithm?
To balance fairness and efficiency by considering both waiting time and service burst.
What is starvation in scheduling, and how is it addressed?
Starvation occurs when lower-priority processes are indefinitely delayed, and it is addressed through aging.
How does the exponential average method estimate process burst time?
By giving higher weight to recent bursts using a smoothing factor.
What is the role of context switching in pre-emptive scheduling?
To save and restore process states when switching between tasks.
Why is process aging important in dynamic priority scheduling?
To ensure long-waiting processes eventually get CPU access.
How does Round Robin improve fairness in scheduling?
By assigning fixed quanta, ensuring each process gets regular CPU access.
What is a time slice, and how does its size affect scheduling performance?
A fixed duration for process execution; shorter slices improve response time but increase overhead.
How do scheduling algorithms balance CPU-bound and I/O-bound processes?
By using strategies that account for process characteristics and system workload.
Why is understanding operating systems crucial for developers?
It helps them manage system resources like CPU, RAM, and file systems effectively.
How do operating systems impact software performance?
By optimizing resource allocation and managing process concurrency.
What lessons can developers learn from operating system algorithms?
Approaches to solving complex resource management problems.
Why are operating systems considered templates for programming solutions?
Their solutions address classic design challenges and can be adapted to various domains.
How does studying operating systems improve debugging skills?
By providing insights into low-level system operations and resource conflicts.
What role do operating systems play in process scheduling?
They allocate CPU time to processes based on algorithms that balance efficiency and fairness.
Why is concurrency a significant focus in operating systems?
It ensures that multiple processes can execute efficiently without conflicts.
How does virtual memory benefit application developers?
By allowing programs to use more memory than physically available on the system.
What real-world problems are addressed by file systems?
Data organization, retrieval speed, and ensuring data integrity.
What is the ultimate goal of learning about operating systems?
To gain a holistic understanding of how software interacts with hardware.