google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.

Sunday, July 20, 2014

Buffer

Definition :-
The kernel could read and write directly to and from the disk for all file system accesses,but system response time and throughput would be poor because of the slow disk transfer rate . The kernel therefore attempts to minimize frequency of disk access by keeping a pool  of internal data buffers,called the buffer cache which contains the data in recently used disk blocks.

A buffer contains two parts:
a memory array that contains data from the disk and
a buffer header that identifies the buffer.

The status of buffer is a combination of the following conditions:
1. The buffer is  currently locked.
2. The buffer contains valid data 
3. The kernel must write the buffer contents to disk before reassigning the buffer this condition is known as "delayed-write"
4. The kernel is currently reading or writing the contents of the buffer to disk.
5. A process is currently waiting for the buffer to become free

Structure of the buffer pool:
The kernel caches data in the buffer pool according to a least recently used algorithm .
The kernel maintains a free list of buffers that preserves the last recently used order.
The free list is a doubly linked circular list of buffers with a dummy buffer header that marks its beginning and end .
Kernel organizes the buffer into separate queues, hashed as a function of the device and block number.

Five typical scenarios the kernel may follow in getblk to allocate a buffer for a disk block
1. The kernel finds the block on its hash queue, and its buffer is free.
2. The kernel cannot find the block on the hash queue,so it allocates a buffer from the free list .
3. The kernel cannot find the block on the hash queue and in attempting to allocate a buffer from the free list ,finds a buffer on the free list that has been marked "delayed write." The kernel must write the "delayed write" buffer to disk and allocate another buffer.
4. The kernel cannot find the block on the hash queue , and the free list of buffers is empty.
5. The kernel finds the block on the hash queue , but its buffer is currently busy.


 

Monday, July 14, 2014

Solve and Test Arithmetic questions

Q1. The  base of a  triangular field is three times its altitude.If the cost of cultivating the field at Rs.24 per hectare be Rs.324, find its base and height.

Ans. Height = 300m , base= 900m


Q2 The average monthly expenditure of a family was Rs.4,050 during first 3 months, Rs. 4,260 during next 4 month and Rs.4,346 during last 5 month of the year. If the total saving during the year be Rs.8,720, find the average monthly income.

Ans. Rs. 4,970


Q3 The student in three classes are in the ratios 2:3:5. If 20 students are increased in each class ,the ratios changes to4:5:7. What is the total number of student before the increase?

Ans. 100


Q4 A papaya tree was planted 2 year ago. It increase at the rate of 20% every year . If  at present , the height of the tree is 540 cm, What was it when the tree was planted?

Ans. 375 cm


Q5 The sum of the ages of a father and son is 45 year. Five year ago , the product of their ages was 4 times the  father's age at that time.Find the present ages of the father and son.

Ans. Father's age i.s 36 year and son 's age is 9 years


Q6. A man sold an article for Rs.161, gaining 1/6th of his outlay. Find the cost price of the article.

Ans. Rs. 138


Q7. Divide Rs.560 among A,Band C so that A may get half as much as C and B may get half as much as C.

Ans. A's shave =Rs. 140, B's shave =Rs. 140, C 's shave= Rs.280


Q8. If in a long division sum ,the dividend is 380606 and the successive remainders from the first to the last are 434,125 and 413,find the divisor.

Ans. 843


Q9. In a hostel there were some students.Average expenditure on their meal was Rs.60.10 more students joined and the expenses increased by Rs.350 ,but average reduced by Rs. 5 .How many students were in the hostel originally?

Ans. 40


Q10. A grocer purchased 80 kg of rice at RS .13.50 per kg and mixed it with 120 kg available at Rs. 16 per kg.At what rate per kg should he sell the mixture to have a gain of 20 per cent?

Ans. Rs 18 per kg

अच्छे विचार करे विचार

  पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...