OS SAQ
OS SAQ
b) What is Priority?
e) What are the differences and similarities between threads and processes?
Differences:
Similarities:
A structure storing process info like ID, state, memory, registers, priority, and I/O details.
h) What is Multi-threading?
Avoid Mutual Exclusion, Prevent Hold and Wait, Allow Preemption, Avoid Circular Wait.
SET 2
Control OS can interrupt a running process. Process runs until completion or waiting state.
Response Time Faster response, better multitasking. Slower response, suitable for batch processing.
Example Round Robin, Priority Scheduling. FCFS (First Come First Serve), Shortest Job First.
It is the mechanism used by the OS to decide which process runs next, ensuring efficient CPU
usage.
A thread managed by the application without OS intervention, making it faster but less
powerful than kernel threads.
i) What is Deadlock?
A situation where two or more processes are stuck waiting for resources held by each other,
preventing execution.
a) Time Sharing – A system where multiple users share CPU time, giving an illusion of simultaneous
execution. Example: Cloud computing.
b) Mutual Exclusion – A principle ensuring that only one process accesses a shared resource at a
time to prevent conflicts. Example: Locking a file while editing.
SET 3
OS as a Resource Manager:
It allocates CPU, memory, storage, and I/O devices efficiently among different users and
processes.
A PCB is a data structure that contains important information about a process, including:
1. Process ID
3. CPU Registers
4. Memory Allocation
5. Priority Level
c) Define Microkernel.
A Microkernel is a small core part of the OS that handles essential functions like process
management and communication, while other services run in user space.
o Types:
CPU Scheduling ensures efficient CPU usage by selecting which process runs next, improving
multitasking and response time.
Load Balancing is the process of distributing tasks evenly across multiple processors to avoid
overload and improve performance.
o Vertex Types:
o Edge Types:
j) Define Starvation.
Starvation happens when a process waits indefinitely because higher-priority tasks keep
getting scheduled before it. Example: A low-priority process never getting CPU time in
Priority Scheduling.
SET 4
7. User Interface – Provides CLI (Command Line) or GUI (Graphical User Interface).
Kernel is the core part of an OS that manages system resources and communication between
hardware and software.
Types of Kernel:
2. Microkernel – Minimal core, with extra services running in user space (e.g., MINIX).
Memory Usage Uses more memory. Shares memory with other threads.
Communication Needs IPC (Inter-Process Communication). Shares data easily within the process.
Process Creation: A new process is created using fork() (in UNIX) or system calls like
CreateProcess() (Windows). It goes through states: New → Ready → Running.
h) What is Homogeneous?
1. Hold and Wait – A process holding one resource waits for another.
2. Circular Wait – A cycle exists where each process waits for a resource held by another.
Circular-Wait is a deadlock condition where processes form a circular chain, each waiting for
a resource held by the next process in the cycle.