Page 21 - demo
P. 21

Program A            Run                 Wait                 Run                 Wait

                             Multiprogramming
                                                 Time

                                                               (a) Uniprogramming









                      Program A            Run                 Wait                 Run                 Wait






                      Program B            Wait   Run              Wait                    Run              Wait



                                           Run Run                                  Run Run
                      Combined                                     Wait                                     Wait
                                            A       B                                 A      B

                                                 Time

                                                  (b) Multiprogramming with two programs



                        There must be enough memory to hold the OS (resident

                           monitor) and one user program
                      Program A            Run                 Wait                 Run                 Wait
                        When one job needs to wait for I/O, the processor can switch to

                           the other job, which is likely not waiting for I/O
                      Program B            Wait   Run              Wait                    Run              Wait





                      Program C               Wait        Run                Wait                  Run          Wait




                                           Run Run Run                              Run Run Run
                      Combined                                         Wait                                     Wait
                                            A       B      C                          A      B       C

                                                 Time

                                                 (c) Multiprogramming with three programs




                                          Figure 2.5   Multiprogramming Example
   16   17   18   19   20   21   22   23   24   25   26