Page 27 - DCAP403_Operating System
P. 27

Operating System




                    Notes                                     Figure 2.3: Multiprogramming

                                                  Program 1                             Program 2



                                             Idle         Idle                     Idle          Idle
                                       P1           P1             P1        P2            P2            P2

                                                             (a) Sequential Execution


                                                                                     Program 1
                                             P1               P1                P1



                                                                                             Program 2

                                                          (b) Execution in Multiprogramming Environment
                                   When that program needs to wait for some 110 operation, it switches over to program 3 and so
                                   on. If there is no other new program left in the main memory, the CPU will pass its control back
                                   to the previous programs.

                                   Multiprogramming has traditionally been employed to increase the resources utilisation of a
                                   computer system and to support multiple simultaneously interactive users (terminals).

                                   Multiprocessing System

                                   A multiprocessing system is a computer hardware configuration that includes more than one

                                   independent processing unit. The term multiprocessing is generally used to refer to large

                                   computer hardware complexes found in major scientific or commercial applications.
                                   A multiprocessor system is simply a computer that has >1 & not <=1 CPU on its motherboard. If
                                   the operating system is built to take advantage of this, it can run different processes (or different
                                   threads belonging to the same process) on different CPUs.
                                   Today’s operating systems strive to make the most efficient use of a computer’s resources.


                                   Most of this efficiency is gained by sharing the machine’s resources among several tasks
                                   (multi-processing). Such “large-grain” resource sharing is enabled by operating systems without
                                   any additional information from the applications or processes. All these processes can potentially
                                   execute concurrently, with the CPU (or CPUs) multiplexed among them. Newer operating
                                   systems provide mechanisms that enable applications to control and share machine resources at
                                   a finer grain-, that is, at the threads level. Just as multiprocessing operating systems can perform

                                   more than one task concurrently by running more than a single process, a process can perform
                                   more than one task by running more than a single thread.

















          20                               LOVELY PROFESSIONAL UNIVERSITY
   22   23   24   25   26   27   28   29   30   31   32