Question: What is the difference between a program and a process?
Answer: Processes are created from a program in execution. In order to create a process from a program you need the metadata about the program and its location.
There are tools to examine executables, including PE Explorer from Heaven Tools (Windows® only).
We won't focus on the compiler or the linker, only the topics most closely related to the Operating System.
CPU Resources
The CPU is the most important resource within the computer system. Others include main memory, cache, and hard disk (and other I/Os).
The amount of time a scheduler gives to a certain process is measured in milliseconds. If the job cannot be finished it will be kicked out of the CPU and given another chance sometime later.
The loader is in charge of loading a program into main memory as a process. The number of processes within the system is limited so that resources can be devoted to the most important processes. The dispatcher feeds the next process to the CPU.
Preemptive & Nonpreemptive Scheduling
Preemptive processes add additional overhead because they remain in memory. However, it is usually better because it can lead to improved response times, can be removed from their current processor, and are important in interactive environments.
Nonpreemptive processes run until completion or until they yield control of a processor. They are not great because unimportant processes can block important ones indefinitely.
Scheduling Objectives
- Maximize throughput
- Maximize the number of interactive processes receiving acceptable response times
- Minimize resource utilization
- Avoid indefinite postponement
- Enforce priorities
- Minimize overhead
- Ensure predictability
| CPU | FIFO Waiting | RR Wait | RR TA | Response Time | |
| P1 | 10 sec | 3 sec | 17 sec | 27 sec | 17 sec |
| P2 | 20 sec | 0 sec | 0 sec | 40 sec | 0 sec |
| P3 | 15 sec | 20 sec | 40 sec | 55 sec | 40 sec |
| P4 | 30 sec | 15 sec | 15 sec | 45 sec | 15 sec |
You should be able to construct a process timeline from the above table. Also notice that the RR Wait and Response Time columns are equal.



