Question
Easy
In context of semaphores choose the option with valid codes for wait() and signal() functions:
1
Wait (s) { while (s) <= 0; s++ } and signal (s) { s--; }
2
Wait (s) { while (s) <= 0; s--} and signal (s) {s++; }
3
Wait (s) {s--;} and signal (s) { while (s) <= 0; s++ }
4
Wait (s) { s++; } and signal (s) { while (s) <= 0; s--; }
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Operating Systems & Software Concepts
Topic: MS Window
Correct Answer
Option B
Explanation
The correct option is (2): The classical definition of a semaphore’s operations, particularly for a counting semaphore, involves two atomic operations: wait (also called P) and signal (also called V). The function of the wait() operation is to attempt to acquire a resource. It must first check if the resource is available, and if not, it must block or busy-wait. Option 2’s Wait (s) { while (s) <= 0; s--}…Read More
Similar Questions from HTET Exam - Level 3 - Year 2022
Question 1
Easy
Source :
HTET 2022
Consider Column-I and Column-II in context of C++: Column-I - Column-II i. Private - a. Data type modifier ii. Sizeof - b. Visibility specifier iii.…
Chapter :
Object-Oriented Programming (C++)
Topic :
OOP Concepts
Question 2
Easy
Source :
HTET 2022
Calculate number of page faults for reference string 3, 2, 4, 1, 3, 5, 2, 1, 7, 3, 0 considering four frames and eight pages…
Chapter :
Computer System & Hardware Fundamentals
Topic :
Memory
Question 3
Easy
Source :
HTET 2022
1000 of 8421 binary coding system is equal to 1011 in ........ binary coding.
Chapter :
Computer System & Hardware Fundamentals
Topic :
Encoding Schemes and Number System
Question 4
Easy
Source :
HTET 2022
In MS-PowerPoint-2007, size of a slide can be set to A4 size using which of the following options ?
Chapter :
Office Automation Tools
Topic :
Presentation Software (MS Power-Point)