Multiprogramming:
- Multiprogrammingbecame possible when disks
were introduced to the computing world. The concept of
multiprogramming relies on the capability of a computer to store
instructions (programs) for long-term use. The goal is to reduce
CPU idle time by allowing new jobs to take over the CPU whenever
the currently running job needed to wait (e.g. for user I/O).
- It was also at this point when operating systems received a new
responsibility - decision making. Before multiprogramming
was introduced, the role of the operating system was simple and
straight-forward - load a program into memory and execute it via
the CPU.
- With the advent of multiprogramming, operating systems now
faced different mechanics for program execution as multiple jobs
now needed to be loaded into memory at the same time and several
options existed for allocating CPU time.
- Two types of scheduling were introduced to handle this
decision-making - job scheduling and CPU
scheduling. Job scheduling refers to the
selection of jobs to load into memory. CPU scheduling
refers to the selection of a job existing in memory to execute via
the CPU. In a computer system, both these decisions are made by the
operating system.
Time sharing system:
- A time sharing system or Multitasking system allows many users
to share the computer resources simultaneously. In other words,
time sharing refers to the allocation of computer resources in time
slots to several programs simultaneously. For example a mainframe
computer that has many users logged on to it. Each user uses the
resources of the mainframe -i.e. memory, CPU etc. The users feel
that they are exclusive user of the CPU, even though this is not
possible with one CPU i.e. shared among different users.
- he time sharing systems were developed to provide an
interactive use of the computer system. A time shared system uses
CPU scheduling and multiprogramming to provide each user with a
small portion of a time-shared computer. It allows many users to
share the computer resources simultaneously. As the system switches
rapidly from one user to the other, a short time slot is given to
each user for their executions.
- The time sharing system provides the direct access to a large
number of users where CPU time is divided among all the users on
scheduled basis. The OS allocates a set of time to each user. When
this time is expired, it passes control to the next user on the
system. The time allowed is extremely small and the users are given
the impression that they each have their own CPU and they are the
sole owner of the CPU. This short period of time during that a user
gets attention of the CPU; is known as a time slice or a
quantum.
- The time-shared systems are more complex than the
multi-programming systems. In time-shared systems multiple
processes are managed simultaneously which requires an adequate
management of main memory so that the processes can be swapped in
or swapped out within a short time.
Advantages of Time-sharing operating
systems:
- Provides the advantage of quick response.
- Avoids duplication of software.
- Reduces CPU idle time.
Disadvantages of Time-sharing operating
systems:
- Problem of reliability.
- Question of security and integrity of user programs and
data.
- Problem of data communication.