UGC NET Paper 2 (Computer Science)Hard
In the bounded-buffer producer-consumer solution with n slots, the semaphores empty, full and mutex are initialised respectively to:
- A. n, 0, 1
- B. 0, n, 1
- C. 1, 0, n
- D. n, n, 0
Correct answer: A. n, 0, 1
empty counts free slots (n), full counts filled slots (0) and mutex is binary (1); swapping the order of waits can cause deadlock.
Practise more UGC NET Computer Science and Applications questionsUGC NET Computer Science and Applications: notes and key points
More UGC NET Computer Science and Applications questions
- A Unix-style inode has 12 direct pointers and one single indirect pointer. With 4 KB blocks and 4-byte block pointers, the maximum file…
- For three tasks, the Liu-Layland utilization bound for Rate Monotonic scheduling, n(2^(1/n) - 1), is approximately:
- Consider. I. Strict 2PL ensures conflict serializability. II. Strict 2PL ensures cascadeless schedules. III. 2PL guarantees freedom from…
- A file has 100,000 fixed-size records stored 10 per block in sorted order. A binary search on the sorting key needs at most how many block…
- In the wait-die deadlock prevention scheme, if an older transaction requests a lock held by a younger one:
- A Class B network 172.16.0.0 is to be divided into 8 equal subnets. The subnet mask is: