Discussion
P and Q are amongst the five synchronization objects supported by windows.
P blocks access to a resource until some other thread or process signals that it may be used. Q prevents a block of code being used by more than one thread at a time.
What is P and Q ?
Answer: B
P is an Event object and Q a critical section object.
A Windows event object blocks threads waiting on it until another thread or process signals it, so it fits P, 'blocks access ... until some other thread or process signals that it may be used'. A critical section object lets only one thread of a process at a time execute a protected block of code, which matches Q.
A waitable timer is signalled when a set time arrives, not by another thread, so it does not fit Q. A semaphore limits access to a count of users, and although a mutex also gives mutual exclusion, it does not fit P, which is signalled rather than owned and released.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development