Professional Documents
Culture Documents
04 Quiz Arg
04 Quiz Arg
04 Quiz Arg
2. How does the structure of counting semaphore primitives differ from binary semaphore
primitives?
Binary semaphores are only capable of holding two values: one to indicate that a
process or thread is in the critical section (the code that accesses the shared resource)
and that other processes or threads should wait, and the other to indicate that the
critical section is free.
Contrarily, counting semaphores accept more than two values and can take any value.
As long as they take the maximum value X, X processes or threads can use the shared
resource at once.
3. Briefly explain the purpose of the semWaitB and semSignalB function in Figure - -
4. Based on Figure 1 and 2, which semaphore structure is easier to implement and why?
6. Would you agree that a monitor, as a concurrency mechanism, can support process
synchronization? Why or why not?
- One of the features of a monitor is the queue for an entering procedure. The
process enters in a big way at this point. Without this characteristic, a process
cannot enter the monitor, and the monitor can not support concurrent
operations. The monitor will begin the procedure as soon as possible if it is
critical. If not, the monitor will see if the procedure is prepared to start. It will be
done if it is. If not, it will delay until it is prepared to be carried out.