Wednesday, October 15, 2014

4 necessary conditions for occurrence of deadlock



Four necessary conditions for occurrence of deadlock in databases / Four necessary conditions for deadlock to occur / Necessary and sufficient conditions for deadlock / List and discuss four conditions for deadlock / Necessary conditions that ensures a deadlock occurrence state

 

Necessary conditions for deadlock to occur in database


A deadlock can arise if the following 4 conditions hold simultaneously in a system;

  • Mutual exclusion: At least one resource is held in a non-sharable mode. For example, among transactions if there is any Exclusive lock (Write lock) request, that data item cannot be shared with others.
  • Hold and wait: There is a transaction which acquired and held lock on a data item, and waits for other data item.
  • No preemption: A situation where a transaction releases the locks on data items which it holds only after the successful completion of the transaction. Not on voluntarily.
  • Circular wait: A situation where a transaction say T1 is waiting for another transaction T2 to release lock on some data items, in turn T2 is waiting for another transaction T3 to release lock, and so on.
During transaction processing, if all the said conditions are held then there occurred a deadlock.


Go to Deadlock Handling Techniques in Database page
Go to Database Management Systems Home page

List of necessary conditions for deadlock to happen in database

Strengths and weaknesses of trigger mechanisms


Strengths and Weaknesses of Triggers / Advantages and Disadvantages of using Triggers / Merits and Demerits of Trigger mechanisms

 

Strengths and Weaknesses of Triggers / Trigger mechanisms


Strengths


  • Used for enforcing referential integrity.
  • Easy to implement business rules through triggers.
  • Event logging is easier.
  • It can control transactions hence lead to safer transactions.
  • Consistency is maintained.
  • Efficiency in performing transactions.
  • Cascading referential integrity.
  • Implicitly called for actions during database changes. Very much helpful in a case where many changes need to be done on different tables for a single action.

Weaknesses

  • Triggers should be written with extra care. Trigger error may lead to failure of insert, delete, or update operations at runtime.
  • Excessive use of triggers can result in complex interdependencies. For example, cascading triggers can induce chain of actions.
  • Increased complexity.
  • May decrease the performance of the database.
  • Every time a trigger is fired, its code must be recompiled.
  • Database triggers can be accidentally disabled or dropped by a person with sufficient privilege.
  • The hidden nature of triggers is another important weakness.



Wednesday, October 8, 2014

What are the performance measures of hard disk drives?



Performance measures of hard disks / Important measures used for finding the hard disk drive performance / The major performance measures of a HDD

 

What are the performance measures of hard disks?


Function of a hard disk

First, let us see the function and internals of a hard disk drive. See the figure given below for the essential things inside the hard disk arrangement for our discussion.
Figure 1 - internal component of a hard disk drive
Platter - flat circular disk (like CDs or DVDs) that hold data
Track - the logical division of a side of a platter 
Read-write head - a small part of hard disk that move above the disk platter to read or write data from or to disk. [read-write head transform the platter's magnetic field into electrical current - reading, read-write head transform the electrical current into magnetic field - writing]
Spindle - fixed setup which rotates the platters

How does a hard disk drive function?

If a request is initiated by the Operating System to read a file, the information is passed on to the Disk-controller, and the disk-controller initiates necessary actions.

  1. Read-write head is positioned over the right track where the required data might be stored.
  2. Platters are rotated to bring the right sector under the read-write head.
  3. The data transfer begins at this point.

Watch the video to see the movements of the internal components. [video is taken from Wikipedia.org].

Various performance measures of hard disk



They are,

  • Disk capacity,
  • Access time,
  • Data-transfer rate
  • Reliability,
  • Power consumption and Shock resistance.


Disk Capacity – the amount of data which can be stored (measured in terms of GBs / TBs today).
Access time – the time consumed between the request initiation and the beginning of data transfer.
For example, if you would like to open a file, you need to click/double click the file. That moment, the request is generated. This is the request initiation time. To access the data on a particular sector, the disk arm is positioned the read/write head over the correct track of the required sector. Then the disk platter is rotated to position the correct sector under the read-write head. At this moment the transfer begins. This is the data transfer beginning time. The actual time consumed between these two times is called the Access time.
The key components that are considered in calculating the Access time are;

  • Seek time – the time for repositioning the arm so that the read-write head can be positioned over the correct track. [Average seek time for Seagate hard disk drive Barracuda 7200.9 is 11 ms approximately]

  • Rotational latency time – the time spent for the required sector to appear under the read-write head. [Typical rotational latency for hard disk drive with the speed of 7200 rpm is 4.17 ms approximately]

Hence,
Access time = Seek time + Rotational latency time
Data transfer rate – the rate (speed) at which data can be read from / written to a disk. [Maximum external transfer rate for Seagate hard disk drive Barracuda 7200.9 is 300 MB/s approximately].

Data transfer rate = minimum (the speed at which the data can be moved between disk surface and disk controller, the speed at which the data can be moved between disk controller and the host system)
For example,
Data transfer rate = minimum (100 MB/s, 150 MB/s) = 100 MB/s.
Reliability – How far a disk is reliable, ie., free from failure is one of the major measures. Mean-Time-To-Failure (MTTF) is the measure used to calculate the reliability of the disk. [Typical MTTF value ranges from 30,000 hours to 1,200,000 hours today]
Power consumption and Shock resistance– they are the other issues which are very much analyzed in today’s scenario for the cases mobile devices such as laptops. To get rid of waste heat pollution, these measures should be considered for even desktop computers also.

External link -
Hard disk drive performance characteristics 

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents