Page 227 - DCAP103_Principle of operating system
P. 227

Principles of Operating Systems



                   Notes         involve several network communications or several disk reads and writes, or both. Systems that
                                 attempt such a full set of functionalities tend to perform poorly. A successful implementation
                                 of complex sharing semantics can be found in the Andrew File System. For the following
                                 discussion, we assume that a series of file accesses (that is, reads and writes) attempted by a
                                 user to the same file is always enclosed between the open and close operations. The series of
                                 accesses between the open and close operations is a file session. To illustrate the concept, we
                                 sketch several prominent examples of consistency semantics.
                                 6.8.1 UNIX Semantics

                                 The UNIX file system uses the following consistency semantics—Writes to an open file by a user
                                 are visible immediately to other users that have this file open at the same time. One mode of
                                 sharing allows users to share the pointer of current location into the file. Thus, the advancing of
                                 the pointer by one user affects all sharing users. Here, a file has a single image that interleaves
                                 all accesses, regardless of their origin. In the UNIx semantics a file is associated with a single
                                 physical image that is accessed as an exclusive resource. Contention for this single image results
                                 in user processes being delayed.

                                 6.8.2 Session Semantics
                                 The Andrew file system (AFS) uses the following consistency semantics: Writes to an open file
                                 by a user are not visible immediately to other users that have the same file open simultaneously.
                                 Once a file is closed, the changes made to it are visible only in sessions starting later. Already
                                 open instances of the file do not reflect these changes. According to these semantics, a file may be
                                 associated temporarily with several (possibly different) images at the same time. Consequently,
                                 multiple users are allowed to perform both read and write accesses concurrently on their image
                                 of the file, without delay. Almost no constraints are enforced on scheduling accesses.

                                 6.8.3 Immutable-Shared-Files Semantics
                                 A unique approach is that of immutable shared files. Once a file is declared as shared by its
                                 creator, it cannot be modified. An immutable file has two key properties: Its name may not be
                                 reused and its contents may not be altered. Thus, the name of an immutable file signifies that
                                 the contents of the file are fixed, rather than the file being a container for variable information.
                                 The implementation of these semantics in a distributed system is simple, because the sharing
                                 is disciplined (read-only).
                                 6.9 Protection Mechanisms


                                 The concept of multiprogramming introduces the sharing resources among users. This sharing
                                 involves  Memory,  I/O  devices,  Programs  and  Data.  The  ability  to  share  these  resources
                                 introduces the need for protection. An OS may offer protection along the following Spectrum:
                                 No Protection: This is appropriate when sensitive procedures are being run at separate times
                                 Isolation. This approach implies that each process operates separately from other processes, with
                                 no sharing. Each process has its own address space, files, and other objects Share all or Share
                                 nothing: In this method, the owner of an object declares it to be public or private, in the other
                                 words, only the owner‘s processes may access the object. Share via access limitation—The OS
                                 checks the permissibility of each access by a specific user to specific object; the OS therefore acts
                                 as a guard between users and objects, ensuring that only authorized accesses occur. Share via
                                 dynamic capabilities: This extends the concept of access control to allow dynamic creation of
                                 sharing rights for objects. Limit use of an object—This form of protection limits not just access to
                                 an object but the use to which that object may be put. A given OS may provide different degree
                                 of protection for different objects, users and applications The OS needs to balance the need to
                                 allow sharing, with the need to protect the resources of individual users.






        220                               LOVELY PROFESSIONAL UNIVERSITY
   222   223   224   225   226   227   228   229   230   231   232