Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3 Software Design Problem (7 marks) Most modern operating systems include support for a class called something like Semaphore, which acts like the Semaphores we've
3 Software Design Problem (7 marks) Most modern operating systems include support for a class called something like Semaphore, which acts like the Semaphores we've been discussing in class and in the lab. As we have seen, Semaphores provide two operations: Semaphore::Wait() (seize the resource, or wait for somebody else to signal it) and Semaphore::Signal() (yield the resource, or unblock a waiting process). However, modern operating systems also support a class with a name like SemaphoreList. This is a collection of Semaphores (list, or vector, or stack, or something). SemaphoreList objects provide two additional operations: SemaphoreList::WaitAll() and SemaphoreList::WaitAny(). With this information in mind, provide solutions to the following two design problems. Your solutions can be plain English, some pseudocode, some source code in some language, a block diagram, a flow chart, or any other means you have of demonstrating your understanding. In these answers, feel free to make use of any of the Operating System construct we have used (semaphores, mutex, messages, threads, shared memory, etc.). a. (3 marks) The function SemaphoreList::WaitAll() blocks until each and every semaphore in the list is signalled. Provide a design for this function. (NOTE: Do NOT worry about the possibility that some other process can "steal" a signal from you.) b. (4 marks) The function SemaphoreList:: WaitAny() blocks until ANY ONE of the Semaphores is signaled. The moment one of them signals, the block is interrupted. Provide a design for this function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started