1/204
Looks like no tags are added yet.
What is a process in an operating system?
A program in execution that includes its code, data, stack, and current state.
What are the main components of a process?
Code, data, stack, program counter, and CPU registers.
What triggers process creation?
System calls like fork() or exec() initiated by the OS or user.
What is process termination?
When a process finishes execution and releases system resources.
What is multiprogramming?
Running multiple processes concurrently on a single CPU for efficiency.
Why is concurrency important?
It allows overlapping of I/O and computation for better resource use.
What is the difference between concurrency and parallelism?
Concurrency interleaves tasks; parallelism runs them simultaneously.
What is the Process Control Block (PCB)?
A data structure storing all info about a process (state, registers, memory, etc.).
What are the five main process states?
New, Ready, Running, Waiting (Blocked), Terminated.
What transitions a process from Ready to Running?
The CPU scheduler dispatches it to execute.
What causes a process to move from Running to Waiting?
An I/O request or blocking event.
What causes a process to move from Running to Ready?
A timer interrupt or preemption.
What is context switching?
Saving one process's state and loading another's to switch execution.
Why is context switching costly?
It consumes CPU cycles but performs no useful computation.
What is interprocess communication (IPC)?
A mechanism allowing processes to share data or signals.
What are the two IPC models?
Shared memory and message passing.
What is shared memory IPC?
Processes share a region of memory and coordinate with synchronization.
What is message passing IPC?
Processes exchange messages through OS-managed send/receive calls.
When is shared memory preferred?
When high data volume and efficient synchronization are possible.
What is a pipe?
A unidirectional channel for communication between related processes.
What is a named pipe?
A pipe accessible via the file system for unrelated processes.
What are signals?
Software interrupts used to notify a process of an event (e.g., SIGTERM).
What is RPC?
Remote Procedure Call—invoking functions across machines like local calls.
What are IPC challenges?
Synchronization, deadlocks, and data consistency.
What is address translation?
Mapping logical (CPU) addresses to physical memory addresses.
What does the Memory Management Unit (MMU) do?
It performs address translation at runtime.
Why is address translation necessary?
To isolate process memory and support virtual addressing.
What is process isolation?
Preventing processes from accessing each other's memory space.
What is the benefit of process isolation?
Improves system stability and security.
What is process hierarchy?
Parent-child process relationships (UNIX fork-exec model).
What does fork() do?
Creates a new child process identical to the parent.
What does exec() do?
Replaces a process's memory with a new program.
What happens when a parent terminates before a child?
The child becomes an orphan, adopted by init/systemd.
What are zombie processes?
Finished processes still occupying a table entry.
Why do zombie processes occur?
The parent hasn't yet read their exit status.
What is process scheduling?
Selecting which process gets CPU time next.
Why does single-CPU scheduling matter?
Only one process runs at a time; others must wait.
What is process starvation?
When low-priority processes never get CPU time.
How can starvation be prevented?
Using aging to gradually increase waiting process priority.
What is process synchronization?
Coordinating access among processes sharing resources.
What is a thread?
A lightweight unit of execution within a process sharing memory.
How do threads differ from processes?
Threads share code/data; processes have separate memory.
What does each thread maintain?
Its own program counter, registers, and stack.
Why use threads?
They improve responsiveness and efficiency by overlapping tasks.
What is a multithreaded process?
A process with multiple threads executing concurrently.
What are the two main thread types?
User-level threads and kernel-level threads.
What is a user-level thread?
Managed in user space without kernel involvement.
What is a kernel-level thread?
Managed directly by the OS scheduler.
What are advantages of user-level threads?
Fast switching and low overhead.
What are disadvantages of user-level threads?
If one thread blocks, the whole process blocks.
What is the advantage of kernel-level threads?
Each thread can be scheduled independently.
What is the disadvantage of kernel-level threads?
Higher overhead due to system calls.
What is a hybrid threading model?
Maps many user threads to fewer kernel threads (M:N).
How does thread context switching compare to process switching?
Thread switches are faster due to shared address space.
What is concurrency in threading?
Interleaved thread execution for shared progress.
What is parallelism in threading?
Actual simultaneous execution on multiple cores.
What is thread synchronization?
Coordinating threads accessing shared data to prevent conflicts.
Why is synchronization important in threads?
It prevents race conditions.
What is a race condition?
When output depends on the unpredictable order of execution.
What is thread safety?
Ensuring shared data access doesn't produce errors.
What is a critical section?
A part of code that must not be executed by multiple threads at once.
What are common synchronization primitives?
Locks, semaphores, and monitors.
What is thread pooling?
Reusing a fixed set of threads to handle multiple tasks.
What is the benefit of thread pooling?
Reduces overhead from thread creation/destruction.
What is thread scheduling?
Deciding which thread runs next on a core.
What happens if the main thread terminates?
Depending on design, all threads may terminate.
What is a daemon thread?
A background thread that ends when the process exits.
What is thread priority?
A value determining thread scheduling order.
How do user and kernel-level scheduling differ?
User-level libraries schedule within a process; kernel schedules system-wide.
What is thread blocking?
When a thread waits for I/O or synchronization.
What causes thread deadlocks?
Improper resource acquisition order among threads.
What is thread yield?
Voluntarily giving up CPU to allow other threads to execute.
What is context switch overhead for threads?
Low, since memory space is shared.
What are benefits of multithreading?
Responsiveness, resource sharing, and performance.
What is a drawback of multithreading?
Harder debugging and risk of synchronization errors.
Why is multithreading beneficial for servers?
It allows concurrent request handling efficiently.
What happens in thread synchronization failure?
Data inconsistency or crashes.
What is CPU scheduling?
Deciding which process gets the CPU next.
What are the main scheduling goals?
Maximize CPU utilization, throughput, and fairness; minimize waiting and response time.
What is turnaround time?
Total time from submission to completion.
What is waiting time?
Time spent in the ready queue.
What is response time?
Time from request to first CPU response.
What is throughput?
Number of processes completed per unit time.
What is CPU utilization?
Percent of time CPU is doing useful work.
What are process states?
New, Ready, Running, Waiting, Terminated.
What triggers scheduling?
Process creation, termination, or I/O completion.
What is preemptive scheduling?
Processes can be interrupted for higher-priority ones.
What is non-preemptive scheduling?
Processes run to completion before switching.
Why use preemptive scheduling?
Improves responsiveness.
Why use non-preemptive scheduling?
Simpler and lower overhead.
What is dispatcher latency?
Time to switch from one process to another.
What is FCFS scheduling?
First Come, First Served—non-preemptive.
What is a drawback of FCFS?
Long jobs delay short ones (convoy effect).
What is SJF scheduling?
Shortest Job First—executes process with smallest CPU burst.
Why is SJF optimal?
Minimizes average waiting time.
What is the limitation of SJF?
Requires predicting CPU burst time.
What is SRTF scheduling?
Shortest Remaining Time First—preemptive version of SJF.
What is Priority Scheduling?
Runs the highest-priority process first.
What problem arises in Priority Scheduling?
Starvation of low-priority processes.
What prevents starvation?
Aging (increasing waiting process priority).