Question: (1 The enter_CS( ) and leave_CS( ) functions to implement critical section control of a process are realized using test and set instruction as follows:

(1The enter_CS( ) and leave_CS( ) functions to implement critical section control of a process are realized using test and set instruction as follows:

void enter_CS(X)

{ while (test-and-set(X));

}

void leave_CS(X)

{ X = 0;

}

Note: X is a memory location associated with the CS and is initialized to 0.

Answer the following questions:

  1. Describe the condition that allow process to enter the CS
  2. Describe what will a process do when leaving CS
  3. Is the above solution deadlock free? Explain.
  4. Will process enter CS in FIFO order
  5. Is the above solution starvation free? Explain.

(2A counting semaphore S is initialized to 10. Then, 6 P operations and 4 V operations are performed on S. What is the final value of S?

(3What is the maximum file size supported by a file system using i-node disk allocation scheme with 16 direct blocks, single, double, and triple indirection? The block size is 512 bytes. Disk block numbers can be stored in 4 bytes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!