First half Flashcards
What is a process in the context of an operating system?
A program in execution, consisting of executable code, associated data, and a Process Control Block (PCB).
What information does the OS maintain in control structures?
Tables for memory, I/O devices, files, and processes.
What is the role of the Process Control Block (PCB)?
It contains all information required by the OS to manage a process, such as identifiers, CPU state, and control information.
What is stored in the memory tables of the OS?
Information about memory allocation, protection, and management.
What do I/O tables track?
The status and allocation of input/output devices and channels.
What is the purpose of the file tables?
To manage information about file existence, location, and status.
How are processes organized in the process tables?
Using cross-references to memory, I/O, and file tables.
What is the primary function of the Process Control Block?
To store process attributes for management and administration by the OS.
What are the three main categories of information in a PCB?
Process identification, CPU state information, and process control information.
Why are PCBs essential in process management?
They allow the OS to access all attributes of a process for efficient management and execution.
What are the seven process states in an operating system?
NEW, READY, RUNNING, BLOCKED, BLOCKED SUSPEND, READY SUSPEND, and TERMINATED.
What happens in the NEW state?
The process is newly created and awaiting resource allocation.
What triggers a process to transition to the READY state?
The process is fully built, loaded into RAM, and waiting for CPU allocation.
When does a process enter the RUNNING state?
When the CPU is allocated to it by the scheduler.
What causes a process to transition to the BLOCKED state?
Waiting for a resource or I/O task.
What is the BLOCKED SUSPEND state?
A process in a blocked state is swapped out to secondary memory due to insufficient RAM.
What happens in the READY SUSPEND state?
A ready process is swapped out of main memory to secondary memory.
When does a process enter the TERMINATED state?
When it has completed execution, and its PCB is deleted.
What is a state transition diagram?
A visual representation of process state changes and the triggers for each transition.
How does the OS decide on process state transitions?
Based on events like CPU allocation, resource availability, or process completion.
What are threads in an operating system?
Units of dispatch within a process that share resources but operate independently.
What are the two types of threads?
User-level threads and kernel-level threads.
How do user-level threads differ from kernel-level threads?
User-level threads are managed by applications, while kernel-level threads are managed by the OS.
What is an advantage of multiple threads in a single process?
They allow concurrent execution paths with shared memory and resources.
What is a process switch?
A switch where the CPU is allocated to a different process, involving context saving and scheduling.
What is a mode switch?
A hardware-level switch where the CPU resumes execution of the same process.
What triggers a process switch?
Events like external interrupts, system calls, or traps.
What is the main difference between a process switch and a mode switch?
A process switch changes the active process, while a mode switch resumes the same process.
Why are threads faster to switch than processes?
They share the same process memory space, requiring less context saving.
How does inter-thread communication compare to inter-process communication?
Inter-thread communication is more efficient because threads share the same address space.
What is the aim of CPU scheduling?
To optimize system performance by allocating CPU access among processes.
What are common evaluation criteria for scheduling algorithms?
Response time, throughput, predictability, and fairness.
What is the difference between pre-emptive and non-pre-emptive scheduling?
Pre-emptive allows process interruption, while non-pre-emptive waits for a process to finish or block.
What is a time slice or quantum in scheduling?
A fixed duration allocated to each process in Round Robin scheduling.
What is First Come, First Served (FCFS) scheduling?
A non-pre-emptive algorithm where processes are served in the order they arrive.
How does Round Robin scheduling address fairness?
By rotating processes in the ready queue with a fixed time quantum.
What is the Shortest Process Next (SPN) algorithm?
A non-pre-emptive scheduling method where the process with the shortest expected burst time is selected.
What is starvation in CPU scheduling?
A situation where a process never gets CPU access due to higher-priority processes.
How does the Highest Response Ratio Next (HRRN) algorithm avoid starvation?
By considering both waiting time and burst time to calculate process priority.
What is Multi-Level Feedback (MLF) scheduling?
A strategy that uses multiple queues with different priorities and rules to manage processes effectively.
What is the purpose of memory management in an operating system?
To manage and allocate memory space efficiently for processes.
What is the difference between main memory and secondary memory?
Main memory is fast, volatile, and costly, while secondary memory is slower, non-volatile, and cheaper.
What is fixed/static partitioning in memory management?
Dividing memory into fixed-sized chunks, which can lead to internal fragmentation.
What is dynamic/variable partitioning?
Allocating memory in variable-sized partitions based on process requirements, which may cause external fragmentation.
What is paging in memory management?
Where processes in primary memory(RAM) are divided into equal-sized pages and stored in available memory frames in secondary memory.
How does paging prevent external fragmentation?
By ensuring all page frames are usable and eliminating the need for contiguous memory allocation.
What is a page table?
A table that maps a process’s pages to physical memory frames.
What is a logical address in paging?
An address relative to a process’s starting point, consisting of a page number and an offset.
What is a physical address in paging?
The actual memory location in RAM, determined by translating the logical address using the page table.
What are the advantages of paging?
It eliminates external fragmentation, minimizes internal fragmentation, and allows flexible memory allocation.
What is virtual memory (VM)?
A memory management technique that uses disk space to simulate additional RAM.
What is the primary goal of virtual memory?
To increase efficiency and flexibility by allowing larger processes and more processes to run simultaneously.
What is a page fault?
An event where a process tries to access a page not currently in main memory.
What happens during a page fault?
The required page is loaded from disk into a free memory frame, and the process is blocked until the operation completes.
What is the resident set in
The set of pages currently loaded in main memory for a process.
in virtual memory, How does the principle of locality of reference help.
It predicts which pages a process will access soon, minimizing page faults.
What is the role of the page table in virtual memory?
To record the location of all process pages, whether in memory or on disk.
What is thrashing in virtual memory?
A situation where excessive page faults occur, causing constant swapping and reducing performance.
How can thrashing be avoided?
By using strategies like the Page Fault Frequency method to balance memory allocation.
What are the benefits of virtual memory?
It allows for efficient multitasking, supports larger applications, and improves resource utilization.
What is a page replacement policy?
A strategy used to decide which page to remove from memory when a new page is loaded.
What is the First-In, First-Out (FIFO) page replacement algorithm?
It removes the oldest page in memory when a new page is needed.
What is the Least Recently Used (LRU) algorithm?
It replaces the page that has not been used for the longest time.
What is the Least Frequently Used (LFU) algorithm?
It replaces the page that has been used the least frequently.
How does the Clock (Second Chance) algorithm work?
It gives pages a second chance if they have been accessed recently, using a circular queue.
What is the purpose of the Not Recently Used (NRU) algorithm?
To categorize pages based on their recent usage and replace the least used ones.
What is a cleaning policy in page replacement?
A method to decide when and how to write modified pages back to disk.
What is a fetch policy in virtual memory?
A strategy that determines when pages should be loaded into memory, either on demand or in advance.
What is the principle of ‘aging’ in page replacement?
A method that approximates LRU by keeping track of page usage over time.
How do replacement algorithms affect system performance?
They impact the frequency of page faults and the efficiency of memory utilization.
What is process concurrency?
The simultaneous execution of multiple processes or threads in a system.
What problems arise from process concurrency?
Issues like deadlocks, race conditions, and resource contention.
What is a critical section?
A part of a program that accesses shared resources and must not be executed by more than one process at a time.
What is mutual exclusion?
Ensuring that only one process can enter the critical section (the segment of code that can access or modify a shared resource) at a time.
What are semaphores in concurrency control?
Variables used to control access to shared resources.
What is a deadlock?
A situation where processes are stuck waiting for resources held by each other, with no progress.
What is a race condition?
A flaw where the system’s behavior depends on the sequence of process execution.
What is a monitor in concurrency?
A synchronization mechanism that allows threads to have mutual exclusion
(the requirement that only one process or thread can enter a critical section at a time)
am i cooked
yes
How can deadlocks be prevented?
By avoiding circular wait, holding resources while requesting others, and prioritizing resource allocation.
is yasantha the goat?
yes