Normal Forms in Database

INF A relation is in first normal form if the domain of each attributes contains only atomic values and value of each attribute contains only a single value from that hand.   #Eliminate duplicative columns from the same table #Create separate table for each group of related data and identify each row with unique column(primary ...

Kernel mode and User mode

Kernel mode In the kernel mode, the executing code has complete and unrestricted access to the underlying hardware. It can execute any CPU instruction and reference any memory address.Kernel mode is generally reserved for the lowest level, most trusted function of operating system.   User mode In user mode, the executing code has no ability ...

Interrupts

An interrupt is a signal to the processor emitted by hardware or software indicating an occurrence of an event that needs immediate attention.The processor responds by suspending its current activities, saving its state, and executing a small program called an interrupt handler (or interrupt service routine, ISR) to deal with the event. This interruption is temporary, and after ...

Floyd’s Algorithm for shortest path

Floyd's Algorithm for shortest path
Based on Dynamic Programming   It is a graph analysis algorithm for finding shortest paths in a weighted graph with positive or negative edge(but without negative cycle)(shortest path between all pairs) The single execution of the algorithm will find the lengths(summed weights) of the shortest paths between all pairs of vertices. though it does not ...

C Calling convention and stack

The formal arguments and local variables are defined inside a function are created at a place in memory called ‘stack’.When the control returns from the function the stack is cleaned up either by the ‘Calling function’ or by the ‘Called function’, which would do this is decided by the calling convention. Standard calling convention in ...

Timestamp Based Protocol 1

Timestamps With each transaction Ti in the system, we associate a unique fixed timestamp, denoted by TS (Ti ). This timestamp is assigned by the database system before the Transaction Ti starts execution. If a transaction Ti has been assigned timestamp TS(Ti) and a new transaction Tj enters the system, then TS(Ti )

Tree Based Protocol 3

Tree Based Protocol
Only exclusive locks are allowed The first lock by Ti may be on any data item. Subsequently a data item Q can be locked by Ti only if the parent of Q is currently locked by Ti Data items may be unlocked at any time. A data item that has been locked and unlocked by ...

Graph Based Protocol

It impose partial ordering on the set D ={d1, d2, d3, …, dn} of all data items. If di -> dj , then any transaction accessing both di and dj must access di before accessing dj it implies that the set D may now be viewed as directed acyclic graph.

Lock Based Protocol 2

Lock Based Protocol
A lock is a mechanism to control concurrent access to a data item. Data items can be locked in two modes 1. Exclusive(X) mode: Data item can be both read as well as written. X-lock is requested using lock-x instruction. 2. Shared(S)-mode: Data item can only be read. S-lock is requested using lock-s instruction Lock ...

Concurrency Control

Concurrency control in Database management systems ensures that database transactions are performed in-parallel without violating the data integrity of the respective databases. Thus concurrency control is an essential element for correctness in a DBMS where two or more database transactions, executed with time overlap, can access the same data, e.g., virtually in any general-purpose database ...