click below
click below
Normal Size Small Size show me how
OS CH2
Processes and Inter-Process Communication (IPC)
| Question | Answer |
|---|---|
| What are the possible states a process can be in? | A process can be in one of three states: running, ready, or blocked |
| Describe the transitions between the three process states. Answer: Process part one | A running process becomes blocked when it waits for an event, such as I/O. A running process becomes ready when the scheduler chooses another process to run. |
| Describe the transitions between the three process states. Answer: Process part two | A blocked process becomes ready when the event it was waiting for becomes available. A ready process becomes running when the scheduler chooses it to run on the CPU. |
| What is a race condition? | A race condition occurs when multiple processes contend for a shared resource, and the final outcome depends on the unpredictable order in which they access and modify the resource, potentially leading to inconsistent results. |
| Example of a race condition | A common example is two processes trying to write to a shared spooler directory |
| What are the four conditions required to avoid a race condition? Answer: part one | No two processes can be in their critical regions at the same time. No assumptions can be made about CPU speeds or the number of CPUs. |
| What are the four conditions required to avoid a race condition? Answer: part two | No process outside of its critical region should block another process. No process should have to wait forever to enter its critical region. |
| How does the "shortest job first" scheduling algorithm work in batch systems? | This algorithm runs the shortest job first. It is the optimal algorithm for minimizing the average turnaround time, which is the total time from job submission to completion. requires knowing the job's duration beforehand, which isn't always practical. |
| what is round robin | A quantum set of time which is cycled through each process. so the larger process doesn't have to start from 0 |