- Batch. Group if jobs submitted to machine together. The operator grouped all of the jobs into various batches with similar characteristics (all the quick jobs might run, then the slower ones, etc.) before running them as one at a time (See Fig. 2). User must wait for results until batch collected and submitted.
Figure 2:
An early batch system.(a) Programmers bring cards to 1401. (b) 1401 reads batch of jobs onto tape. (c) Operator carries input tape to 7094. (d) 7094 does computing. (e) Operator carries output tape to 1401. (f) 1401 prints output.
|
- Result: Improved system throughput and utilization, but lost interactivity.
- Since the I/O used slow mechanical devices, the CPU was often idle waiting on a card to be read or some result to be printed, etc.
- Multiprogramming. Overlap I/O with execution by providing pool of ready jobs. A number of programs were resident in memory and the CPU could choose which one to run (see Fig. 3right).
Figure 3:
Left: Memory layout of a simple batch. Right: A multiprogramming system with three jobs in memory.
|
- Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute.
- A single user cannot, in general, keep either the CPU or the I/O devices busy at all times (uniprogramming, see Fig. 4upper).
Figure 4:
Job Interleaving
|
- One way to choose is to just keep executing the current program until an I/O delay is pending, the CPU would move onto the next program ready to be run (pure multiprogramming, see Fig. 4lower).
- The idea is as follows: The OS keeps several jobs in memory simultaneously. This set of jobs can be a subset of the jobs kept in the job pool-which contains all jobs that enter the system.
- The OS picks and begins to execute one of the jobs in memory. Eventually, the job may have to wait for some task, such as an I/O operation, to complete. In a non-multiprogrammed system, the CPU would sit idle.
- In a multiprogrammed system, the OS simply switches to, and executes, another job. When that job needs to wait, the CPU is switched to another job, and so on.
- Eventually, the first job finishes waiting and gets the CPU back. As long as at least one job needs to execute, the CPU is never idle!
- Multiprogrammed systems provide an environment in which the various system resources (for example, CPU, memory, and peripheral devices) are utilized effectively. Improves throughput and utilization.
- New OS functionalities evolved. Buffering, Direct Memory Access (DMA), interrupt handling, job scheduling policies, memory management and protection. Still not interactive.
Cem Ozdogan
2010-02-20