Process Management - process scheduling, inter-process communication, client-server communication, process synchronization, critical-section problem, Peterson's solution, semaphores - One Line Questions

1. A binary semaphore can have only two values: 0 and 1
2. A counting semaphore is initialized to a non-negative integer. Its value can range from: 0 to N (where N is the number of resources)
3. Using semaphores to solve the producer-consumer problem requires: A binary semaphore for buffer access, and counting semaphores for empty and full buffer slots
4. Priority scheduling can be preemptive or non-preemptive. In preemptive priority scheduling: A higher-priority process can interrupt a lower-priority process
5. In the context of IPC, sockets provide: A network endpoint for communication between processes on different machines
6. Bounded Waiting is a requirement for a critical-section solution, meaning: The number of times other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted must be finite
7. Starvation in process scheduling occurs when: A process is denied CPU time indefinitely
8. What is a process in the context of operating systems? A program in execution
9. Semaphores are synchronization primitives that are used to control access to shared resources. A semaphore is essentially: A variable with associated procedures
10. A semaphore initialized to 0 can be used to: Block processes until a certain event occurs
11. Peterson's solution is a software-based solution for the critical-section problem that works for: Two processes
12. An atomic operation is one that: Is executed as a single, indivisible unit
13. The `signal()` operation on a semaphore (also known as V operation) performs which of the following? Increments the semaphore value and potentially wakes up a blocked process
14. Message passing is another IPC mechanism. It involves: Exchanging messages between processes
15. Which of the following is a common method for IPC? Shared memory
16. Which scheduling algorithm aims to minimize the average waiting time by executing the process with the shortest burst time first? Shortest Job Next (SJN) / Shortest-Process Next (SPN)
17. Progress is a requirement for a critical-section solution, meaning: If no process is in its critical section and some processes wish to enter, then only those not in their remainder section can participate in deciding which will enter next, and this selection cannot be postponed indefinitely
18. Mutual Exclusion ensures that: If one process is executing in its critical section, no other process can be executing in their critical sections
19. The `wait()` operation on a semaphore (also known as P operation) performs which of the following? Decrements the semaphore value and blocks the process if the value becomes negative
20. What is the main advantage of using shared memory for IPC? It is very fast because data does not need to be copied between processes
21. What is a potential issue with client-server communication over a network? Network latency and reliability
22. A race condition occurs when: The outcome of concurrent operations depends on the particular order in which they are executed
23. Deadlock is a situation where: Multiple processes are waiting for each other to release resources
24. A counting semaphore initialized to 1 and used with `wait()` and `signal()` operations behaves like a: Mutex
25. Which of the following synchronization tools is generally considered more primitive and lower-level? Semaphores
26. Which of the following is a requirement for a solution to the critical-section problem? Mutual Exclusion
27. A process enters the waiting state when it: Needs to wait for an I/O operation to complete
28. Which of the following is NOT a typical state of a process? Sleeping
29. Monitors are higher-level synchronization constructs that encapsulate: Shared data and the procedures that operate on it, ensuring mutual exclusion
30. The critical section is a segment of code where a process: Accesses shared resources
31. Which of the following is a method to recover from deadlock? Preempting resources from one or more processes
32. A deadlock can occur if four conditions are met simultaneously: Mutual Exclusion, Hold and Wait, No Preemption, and: Circular Wait
33. In the client-server model, the client typically: Requests a service from the server
34. When a process is currently executing on the CPU, its state is: Running
35. The server in the client-server model typically: Provides services to clients
36. Which mechanism is often used to prevent deadlock by ensuring that a process requests all its required resources at once? Request all resources upfront
37. Which scheduling algorithm is most susceptible to starvation if not implemented carefully? Priority Scheduling (with low-priority processes)
38. Which scheduling algorithm is optimal in terms of minimizing average waiting time but is not practical to implement in most real-time systems? Shortest Remaining Time First (SRTF)
39. The state where a process is ready to be executed by the CPU is called: Ready
40. What is a common use case for the client-server communication model? Web browsing (e.g., HTTP requests to a web server)
41. In client-server communication, Remote Procedure Call (RPC) allows a client to: Execute a procedure on a remote server as if it were local
42. Which scheduling algorithm is non-preemptive and executes processes in the order they arrive? First-Come, First-Served (FCFS)
43. Process synchronization is necessary to: Ensure orderly execution of cooperating processes and prevent race conditions
44. In process scheduling, the concept of 'context switching' refers to: The process of saving the state of the currently running process and loading the state of the next process to run
45. Inter-Process Communication (IPC) refers to: A mechanism for processes to communicate and synchronize their actions
46. Peterson's solution uses two shared variables: an array `flag[2]` and a variable `turn`. `flag[i]` is true if process `i` is ready to enter its critical section. What does `turn` indicate? The process whose turn it is to enter the critical section
47. In Round Robin scheduling, each process gets a small unit of CPU time called a: Quantum
48. What is the primary role of process scheduling? To decide which process in the ready queue should be allocated to the CPU
49. What is the primary purpose of a mutex (mutual exclusion lock)? To provide an atomic way to acquire and release exclusive access to a shared resource
50. Which condition in Peterson's solution ensures mutual exclusion? while (flag[i] && turn == j) ;