Open In App

Consistency Semantics for file sharing

Last Updated : 10 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Consistency Semantics is concept which is used by users to check file systems which are supporting file sharing in their systems. Basically, it is specification to check that how in a single system multiple users are getting access to same file and at same time. They are used to check various things in files, like when will modification by some user in some file is noticeable to others. 

Consistency Semantics is concept which is in a direct relation with concept named process synchronization algorithms. But process synchronization algorithms are not used in case of file I/O because of several issues like great latency, slower rate of transfer of disk and network. 

Example : When an atomic transaction to remote disk is performed by user, it involves network communications, disks read and write or both. System which is completing their task with full set of functionalities, had a poor performance. In Andrew file system, successful implementation of sharing semantics is found. 

To access same file by user process is always enclosed between open() and close() operations. When there are series of access take place for same file, then it makes up a file session. 1. UNIX Semantics : 

The file systems in UNIX uses following consistency semantics –

  • The file which user is going to write will be visible to all users who are sharing that file at that time.
  • There is one mode in UNIX semantics to share files via sharing pointer of current location. But it will affect all other sharing users.

In this, a file which is shared is associated with a single physical image that is accessed as an exclusive resources. This single image causes delays in user processes. 

2. Session Semantics : 

The file system in Andrew uses following consistency semantics.

  • The file which user is going to be write will not visible to all users who are sharing that file at that time.
  • After closing file, changes done to that file by user are only visible only in sessions starting later. If changes file is already open by other user, then changes will not be visible to that user.

In this, a file which is shared is associated with a several images and there is no delay in this because it allows multiple users to perform both read and write accesses concurrently on their images. 

3. Immutable-Shared-Files Semantics : 

There seems a unique approach immutable shared files. In this, user are not allowed to modify file, which is declared as shared by its creator. An Immutable file has two properties which are as follows –

  • Its name may not be reused.
  • Its content may not be altered.

In this file system, content of file are fixed. The implementation of semantics in a distributed system is simple, because sharing is disciplined.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads