Figure 3-2 shows a run queue for a single-CPU environment in which process 8 (proc 8) is running on the CPU and processes 6, 1, 7, and 4 are in the operating system run queue waiting for CPU time. Process 7 is an Adaptive Server process; the others can be any operating system process.
Figure 3-2: Processes queued for a single CPU
In a multitasking environment, multiple processes or subprocesses execute concurrently, alternately sharing CPU resources.
Figure 3-3 shows three subprocesses in a multitasking environment. The subprocesses share a single CPU by switching onto and off the engine over time.
At any one time, only one process is executing. The other processes sleep in various stages of progress.
Figure 3-3: Multithreaded processing