You are on page 1of 2

Counting Semaphore:

1. In your Perspective, what makes counting semaphore primitives a good concurrency


mechanism?
• In this semaphore as a two standard operation it is a Wait and Signal to a critical
problem to process the multiprocessing environment. As for the concurrency
mechanism it so many threads Asynchronous task in single threads and Asynchronous
task in multi-threads to execute the one Resource to Process to another threads or task.
2. How does the structure of counting semaphore primitives differ from binary semaphore?
• The different counting semaphore integer value can range over unrestricted domain full
count and empty count. And to binary semaphore integer value can range only 0 and 1
simpler to implement. Mutex make sure the releasers and receiver don’t access the
buffer at same time. That’s Wait and signal are performed atomically.

Binary Semaphore:

3. Briefly explain the purpose of the SemWaitB and semSignalB function in figure 2.
• The semWaitB in there the value Zero and once their a condition the s.value == one
compare if both side equal and s.value = zero make the left side equal to the right side.
Else the s.value == to place this process in s. queue and for the s.value = zero to block
this process. And the semSignalB if the s. queue is empty no variable the condition is a
remove the process in the s. queue and if the s.value = one has a variable the place
process P are ready to list.
4. Based on figures 1 and 2 which semaphore structure is easier to implement and why?
• The Binary semaphore are the easier to implement for me because the process are too
short because of he needs the only Zero and one process it seems the one process if the
process are no resource to process and block or stop if the process are have resource
wait the process and the signal are the resource are ready.

Monitor:

5. Deduce at least one characteristic of a monitor base on figure 3 Elaborate on your answer.
• We can only execute one process at a time. Monitors re the group of procedures, and
condition variables that are merged together If the process is running outside the
monitor, then it cannot access the monitor’s internal variable. But a process can call the
procedures of the monitor to simplify the complexity of synchronization problems only
one process that can be active at a time inside the monitor.
6. Would you agree that monitor as concurrency mechanism can support process synchronization?
Why or why not?
• Yes, I agree the flow the process just like threads the condition variables for example the
condition c1 is a thread 1 is a holding Area of the resources and the second threads
condition cn is a thread 2 is a process area the resources in the process area if the
resources have a error he go back to holding area and the another resources is going
forward to the process area and the Urgent queue is a threads 3 is a Execute area if the
resources have a error he go back to the process area If no error the resources is going
to leave or ready.

You might also like