Mutual exclusion
Mutual Exclusion is the concept of restricting access to a shared resource. When multiple processes perform operations on a single resource then they might corrupt it. Its the operating systems' responsibility to make sure that this does not happen. There are many methods that can be used to implement mutual exclusion such as semaphores, monitors, etc. Mutual exclusion has the following properties.
Safety: No two processes must use the shared resource at the same time. (Should not be in the critical section at the same time.)
Liveliness: There should not be deadlocks and a process comes out of the critical section after some time.
Fairness: A process wanting to use critical section must only wait some time.
Atomic Transactions
The mutual exclusion of critical sections ensures that the critical sections are executed atomically. That is, if two critical sections are executed concurrently, the result is equivalent to their sequential execution in some unknown order. Although this property is useful in many application domains, in many cases we would like to make sure that a critical section forms a single logical unit of work that either is performed in its entirety or is not performed at all.
An example is funds transfer, in which one account is debited and another is credited. Clearly, it is essential for data consistency either that both the credit and debit occur or that neither occur. Consistency of data, along with storage and retrieval of data, is a concern often associated with database systems. Recently, there has been an upsurge of interest in using database-systems techniques in operating systems.
Operating systems can be viewed as manipulators of data; as such, they can benefit from the advanced techniques and models available from database research. For instance, many of the ad hoc techniques used in operating systems to manage files could be more flexible and powerful if more formal database methods were used in their place. First, however, we deal with the general issue of transaction atomicity. It is this property that the database techniques are meant to address.