Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  At a particular time, the value of a counting... Start Learning for Free
At a particular time, the value of a counting semaphore is 10. It will become 7 after
1. 3 V operations
2. 3 P operations
3. 5 V operations and 2 P operations
4. 13 P operations and 10 V operations
  • a)
    1 and 2
  • b)
    2 and 3
  • c)
    2 and 4
  • d)
    4 only
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
At a particular time, the value of a counting semaphore is 10. It will...
P-denotes wait operation and V denotes signal. Value of counting semaphore initially 10, it will become seven by decreasing it by '3’ which can be done either by ‘3’ wait operation or 13 ‘P’- operation and ‘ 10’ V-operation, which effectively decreases the count by ‘3’.
View all questions of this test
Most Upvoted Answer
At a particular time, the value of a counting semaphore is 10. It will...
Solution:

Given, the initial value of the counting semaphore is 10.

a) After 3 V operations:

- V operation increases the value of the semaphore by 1.
- Therefore, after 3 V operations, the value of the semaphore will become 10 + 3 = 13.
- Hence, option 1 is incorrect.

b) After 3 P operations:

- P operation decreases the value of the semaphore by 1.
- Therefore, after 3 P operations, the value of the semaphore will become 10 - 3 = 7.
- Hence, option 2 is correct.

c) After 5 V operations and 2 P operations:

- After 5 V operations, the value of the semaphore will become 10 + 5 = 15.
- After 2 P operations, the value of the semaphore will become 15 - 2 = 13.
- Hence, option 3 is correct.

d) After 13 P operations and 10 V operations:

- After 13 P operations, the value of the semaphore will become 10 - 13 = -3 (which is not possible as the value of the semaphore cannot be negative).
- Hence, option 4 is incorrect.

Therefore, the correct answer is option C, i.e., the value of the semaphore will become 7 after 5 V operations and 2 P operations.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer?
Question Description
At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer?.
Solutions for At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice At a particular time, the value of a counting semaphore is 10. It will become 7 after1. 3 V operations2. 3 P operations3. 5 V operations and 2 P operations4. 13 P operations and 10 V operationsa)1 and 2b)2 and 3c)2 and 4d)4 onlyCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev