CONCURRENT EXECUTIONS Database Management System

CONCURRENT EXECUTIONS Database Management System

CONCURRENT EXECUTIONS Database Management System

 

CONCURRENT EXECUTIONS Database Management System : When more than one transaction is executing at the same time then we say that there is concurrency. Though running transactions serially (one after the another) would be free of any concurrency problems, concurrency offers the following advantages:

(a) A transaction involves multiple steps, some involving I/O activity and others involving CPU activity. The parallelism of CPU and I/O bound activities can be exploited to run multiple transactions concurrently; thus achieving a higher throughput.

(b) There may be mix of transactions of varying lengths, some short and others long. If run serially, some short transactions may have to wait for a preceding long transaction to complete, leading to unpredictable delays.

Thus, if transactions are operating on disjoint parts of the database, those may be allowed to run Concurrently. It would reduce the average response time for transaction processing. The motivation for using concurrent execution of transactions is similar to the motivation for multi-programming in an Operating System. The DBMS must control the inter-leaving between concurrent transactions in such a way that the overal effect on the database is same as would have been there if the transactions had been executed serially. Such concurrent execution sequences are called schedules. A schedule represents chronological order in which instructions of concurrent transactions.

CONCURRENT EXECUTIONS Database Management System

Schedule 1 & Schedule 2 execute the transactions serially and preserve the consistency of the database, however the values of A and Batthe end would be different in the two schedules. These two schedules are Serial.

When transactions are executed concurrently, OS may execute one transaction for Some time, then perform a context switch, execute another transaction for sometime and then revert back to the execution of first transaction. Now, consider the following schedules, in which the transactions are concurrent:

CONCURRENT EXECUTIONS Database Management System