1What is a process?
A process is a program in execution.
2What is the difference between a program and a process?
A program is a passive executable stored on disk while a process is an active program running in memory.
3What are the main components of a process?
Text section, data section, heap, stack, program counter, and CPU registers.
4What is stored in the text section of a process?
Executable program instructions.
5What is stored in the data section?
Global and static variables.
6What is stored in the stack?
Local variables, function parameters, and return addresses.
7What is stored in the heap?
Dynamically allocated memory.
8What is dynamic memory allocation?
Memory allocated during program execution using functions such as malloc().
9Which memory region stores malloc() memory?
The heap.
10What is the program counter?
The address of the next instruction to execute.
11What are CPU registers used for?
To store temporary execution data and intermediate values.
12What are the five basic process states?
New, Ready, Running, Waiting, and Terminated.
13What is the New state?
The process is being created.
14What is the Ready state?
The process is waiting to be assigned to the CPU.
15What is the Running state?
The CPU is currently executing the process.
16What is the Waiting state?
The process is waiting for an event such as I/O completion.
17What is the Terminated state?
The process has finished execution.
18What is a Process Control Block (PCB)?
A data structure used by the operating system to store information about a process.
19What information is stored in the PCB?
Process state, program counter, CPU registers, scheduling information, memory information, accounting information, and I/O information.
20Why is the PCB important?
It allows the operating system to pause and later resume a process.
21What is a thread?
The smallest unit of CPU execution within a process.
22What resources do threads share?
Code section, heap, and data section.
23What resources does each thread maintain separately?
Stack, program counter, and CPU registers.
24What is process scheduling?
The operating system selecting which process receives CPU time.
25What is the purpose of process scheduling?
To maximize CPU utilization and system responsiveness.
26What is the ready queue?
The set of processes waiting for CPU execution.
27What is the wait queue?
The set of processes waiting for an event such as I/O completion.
28What is a context switch?
The CPU switching from one process to another.
29What happens during a context switch?
The old process state is saved and the new process state is loaded.
30Where is process context stored during a context switch?
In the Process Control Block.
31Why is a context switch considered overhead?
Because no useful work is performed while switching processes.
32What factors affect context switch time?
Operating system complexity, PCB complexity, and hardware support.
33What is a parent process?
A process that creates one or more child processes.
34What is a child process?
A process created by another process.
35What system call creates a child process in UNIX?
fork().
36What does fork() return to the child process?
0.
37What does fork() return to the parent process?
The PID of the child process.
38What does fork() return if an error occurs?
-1.
39What system call replaces a process's memory with a new program?
exec().
40What system call causes a parent process to wait for a child process?
wait().
41What system call terminates a process normally?
exit().
42What system call forcibly terminates a process?
abort().
43What is a zombie process?
A terminated child process whose parent has not called wait().
44What is an orphan process?
A child process whose parent terminated before it did.
45What is cascading termination?
When termination of a parent process causes all child processes to terminate.
46What is interprocess communication (IPC)?
A mechanism that allows processes to communicate and synchronize.
47Why do processes cooperate?
Information sharing, computation speedup, modularity, and convenience.
48What are the two major IPC models?
Shared memory and message passing.
49What is shared memory?
A memory region shared between processes for communication.
50Who controls communication in shared memory?
The user processes.
51What is the biggest issue with shared memory?
Synchronization.
52What is message passing?
Processes communicating by sending and receiving messages.
53What are the two message passing operations?
send(message) and receive(message).
54What is direct communication?
Processes explicitly name each other when sending messages.
55What is indirect communication?
Processes communicate through mailboxes or ports.
56What is a mailbox?
A shared communication object used for indirect communication.
57What is blocking communication?
Communication where the sender or receiver waits.
58What is nonblocking communication?
Communication where execution continues immediately.
59What is a rendezvous?
When both send and receive operations are blocking.
60What is buffering in message passing?
The queue of messages attached to a communication link.
61What is zero-capacity buffering?
No messages are queued and sender and receiver must synchronize.
62What is bounded buffering?
The communication link holds a limited number of messages.
63What is unbounded buffering?
The communication link can hold unlimited messages.
64What is the producer-consumer problem?
A synchronization problem where one process produces data and another consumes it.
65What is an unbounded buffer?
A buffer with no practical size limit.
66What is a bounded buffer?
A buffer with a fixed maximum size.
67What is a pipe?
A communication channel between two processes.
68What is an ordinary pipe?
A unidirectional pipe that typically requires a parent-child relationship.
69What are ordinary pipes called in Windows?
Anonymous pipes.
70What is a named pipe?
A bidirectional pipe that does not require a parent-child relationship.
71What is a socket?
An endpoint for communication.
72What identifies a socket?
An IP address and a port number.
73What is the loopback address?
127.0.0.1.
74What is a Remote Procedure Call (RPC)?
A mechanism that allows a process to call a procedure on another machine as if it were local.
75What is a client stub in RPC?
A proxy on the client side that marshals parameters and contacts the server.
76What is a server stub in RPC?
A proxy on the server side that unpacks parameters and executes the procedure.
77What Linux structure represents a process?
task_struct.
78What information does task_struct store?
PID, process state, parent process, children, open files, and memory information.