Page 35 - DCAP103_Principle of operating system
P. 35

Principles of Operating Systems



                   Notes                 end
                                                remove(resource, available);
                                         end

                                         procedure release(resource: R);
                                         var process: P;
                                         region v do
                                         begin enter(resource, available);

                                         if not empty(requests) then
                                                begin remove(process, requests);
                                                cause(grant[process]);
                                                end

                                         end
                                 Algorithm 3: Scheduling of heavily used resources

                                 If the scheduling rule is completely unknown to the programmer as before, additional variables
                                 are required to ensure that resources granted to waiting processes remain available to them until
                                 they reenter their critical regions.
                                 Algorithm 3 is a simple example of completely controlled resource allocation. A number
                                 of  processes  share  a  pool  of  equivalent  resources.  Processes  and  resources  are  identified  by
                                 indices of type P and R respectively. When resources are available, a process can acquire one
                                 immediately; otherwise, it must enter a request in a data structure of type set of P and wait
                                 until a resource is granted to it. It is assumed that the program controls the entry and removal
                                 of set elements completely.

                                 Conclusion
                                 The essential properties of these concepts are:
                                    1.  A distinction between disjoint and interacting processes;

                                    2.  An association of shared data with operations defined on them;
                                    3.  Mutual exclusion of these operations in time;

                                   4.  Synchronizing primitives which permit partial or complete control of process
                                      scheduling.

                                 1.7.5.5 Multiprocessing
                                 Multiprocessing  is  the  use  of  two  or  more  central  processing  units  (CPUs)  within  a  single
                                 computer system. The term also refers to the  ability  of a system to support more than  one
                                 processor and/or the ability to allocate tasks between them. There are many variations on this
                                 basic theme, and the definition of multiprocessing can vary with context, mostly as a function
                                 of how CPUs are defined.
                                 Multiprocessing sometimes refers to the execution of multiple concurrent software processes
                                 in a system as opposed to a single process at any one instant. However, the terms multitasking
                                 or  multiprogramming  are  more  appropriate  to  describe  this  concept,  which  is  implemented




        28                                LOVELY PROFESSIONAL UNIVERSITY
   30   31   32   33   34   35   36   37   38   39   40