Imagine several jobs competing for one processor. Instead of allowing one job to occupy the CPU until completion, the operating system gives jobs turns and switches among them. When one job waits for slow I/O, another can use the processor. section 2.1
Time sharing keeps a single CPU productive while tasks wait, improving responsiveness and allowing concurrent activity without requiring multiple cores. On multicore machines, the scheduler also assigns jobs across CPUs, so time sharing complements multiprocessing rather than replacing it. section 2.1 section 1.1
A job waiting for tape I/O
Suppose one job must read from or write to tape. Under a single-job approach, the CPU sits idle during that slow operation. With time sharing, the operating system switches to another ready job, so useful processing continues while the first job waits. section 2.1
Time sharing is useful when:
- A task spends substantial time waiting for I/O. section 2.1
- Several tasks need progress on one CPU core. section 1.1
- Applications need better responsiveness while work proceeds concurrently. section 1.1
Use the single-CPU job-state figure to trace how jobs move between running and waiting states as the operating system schedules them. section 2.1
