- While multiprogrammed systems used resources more efficiently i.e. minimized CPU idle time, a user could not interact with a program.
- Time-Sharing Systems Interactive Computing. Time sharing (or multitasking) is a logical extension of multiprogramming. In time-sharing systems, the CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running.
- The user gives instructions to the OS or to a program directly, using a input device such as a keyboard or a mouse, and waits for immediate results on an output device. Accordingly, the response time should be short-typically
less than one second.
- As the system switches rapidly from one user to the next, each user is given the impression that the entire computer system is dedicated to his use, even though it is being shared among many users.
- The CPU switches to the next job that can be run whenever the current job enters a wait state or after the current job has used a standard unit of time.
- When viewed over a relatively long time frame, we obtain the appearance that the CPU is simultaneously running multiple programs.
- A time-shared OS uses CPU scheduling and multiprogramming to provide each user with a small portion of a time-shared computer.
- Time-sharing and multiprogramming require several jobs to be kept simultaneously in memory. Since in general main memory is too small to accommodate all jobs, the jobs are kept initially on the disk in the job pool.
- Processes are swapped in and out of main memory to the disk. In effect, we are now ``memory sharing'' between competing users (programs). This idea leads to a mechanism called virtual memory.
- Virtual memory is a technique that allows the execution of a process that is not completely in memory. The main advantage of the virtual-memory scheme is that it enables users to run programs that are larger than actual physical memory.
- If several jobs are ready to be brought into memory, and if there is not enough room for all of them, then the system must choose among them. Making this decision is job scheduling.
- When the OS selects a job from the job pool, it loads that job into memory for execution. Having several programs in memory at the same time requires some form of memory management.
- In addition, if several jobs are ready to run at the same time, the system must choose among them. Making this decision is CPU scheduling.
- Further, it abstracts main memory into a large, uniform array of storage, separating logical memory as viewed by the user from physical memory.
- This arrangement frees programmers from concern over memory-storage limitations.
- Time-sharing systems must also provide a file system. The file system resides on a collection of disks; hence, disk management must be provided.
- Also, time-sharing systems provide a mechanism for protecting resources from inappropriate use.
- To ensure orderly execution, the system must provide mechanisms for job synchronization and communication, and it may ensure that jobs do not get stuck in a deadlock, forever waiting for one another.
- New OS Functionalities: More complex job scheduling, memory management, concurrency control and synchronization.
- The sensible sharing of resources such as CPU time and memory must be handled by the OS. For this control program to always be in control, we require that it never be blocked from running. The OS, which might in fact be organized like a small number of cooperating programs, will lock itself into memory and then control CPU allocation priority in order that it never be blocked from running.
Cem Ozdogan
2010-02-20