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:
- Describe the condition that allow process to enter the CS
- Describe what will a process do when leaving CS
- Is the above solution deadlock free? Explain.
- Will process enter CS in FIFO order
- 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
Get step-by-step solutions from verified subject matter experts
