Question 61: What is true about up() and down() operations of semaphore?
- The operations up() and down() must have to be atomic.
- The operations up() and down() can be made atomic by using the hardware based solution like TSL.
- The semaphore variable is a user level variable, but can’t be accessed directly.
- Both options 1 and 2.
Solution: They have to be atomic otherwise there can be race conditions. Hence, the correct answer is option 4.