0% found this document useful (0 votes)
39 views3 pages

03 Activity 3 - ARG

The document discusses counting semaphores and monitors as concurrency mechanisms. It notes that counting semaphores use numerical values and three methods - initialize, decrement, and increment. Counting semaphores are easier to implement than binary semaphores as they can monitor remaining resources using increments and decrements. Monitors allow only one process at a time and isolate protected resources, but a malicious process could access a database without monitor approval, undermining encapsulation. Monitors can support process synchronization by achieving mutual exclusion across processes using internal variables inaccessible outside the monitor.

Uploaded by

stapa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

03 Activity 3 - ARG

The document discusses counting semaphores and monitors as concurrency mechanisms. It notes that counting semaphores use numerical values and three methods - initialize, decrement, and increment. Counting semaphores are easier to implement than binary semaphores as they can monitor remaining resources using increments and decrements. Monitors allow only one process at a time and isolate protected resources, but a malicious process could access a database without monitor approval, undermining encapsulation. Monitors can support process synchronization by achieving mutual exclusion across processes using internal variables inaccessible outside the monitor.

Uploaded by

stapa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CPE 301

Operating Systems November 8,


2022

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


mechanism?
 Counting semaphore is very much an excellent concurrent mechanism since it offers a
seamless manner for concurrent management, and consequently, they have the
potential for great performance at the cost of usage complexity. It employs a
transmission procedure involving numerical value. Three methods—initialize,
decrement, and increment—are used in counting semaphore. The procedure is halted,
as is the increase, by the decrease open a block in the operation.

2. How does the structure of counting semaphore primitives differ from binary semaphore
primitives?
 A process or a thread can be used to synchronize access to a shared resource,
depending on the entity making the request. By nature, binary semaphores are just
simply binary. There are only two possible values for them: one to indicate that the
important portion, which includes the code that accesses the shared resource, is
occupied and that other process or threads must wait, and another to denote that the
crucial section is free. Semaphores, on the contrary side, are counted that use more
than two values and can have any value.
3. Briefly explain the purpose of the semWaitB and semSignalB functions in Figure 2.
 The “if else statement” used by semWaitB to determine if a statement is either true or
false and serves as the basis for both semWaitB and semSignalB. The function would be
zero if the value is the same as the true statement, whereas if the value becomes false,
it will halt the queue process. The second one is semSignalB, which works by moving the
process to the ready list if the statement is false.

4. Based on Figures 1 and 2, which semaphore structure is easier to implement and why?
 According to both Figures 1 and 2, the counting semaphore is simpler to operate since it
employs increment and decrement. Whereas if value is intended to be blocked or
unblocked, it helps with coding. When there are resources available, a counting
semaphore can monitor the quantity of remaining resources. The semaphore counter
goes down by one when a thread accesses one of the semaphores and goes up by one
when the thread releases the semaphore.
5. Deduce at least one characteristics of a monitor based on figure 3 Elaborate on your
answer.
 The fact that only one process can be operational at a time on a monitor, which is a
significant problem with monitors, undermines encapsulation. "Procedure k" The
Readers-Writers issue isolates the protected resource from the monitor, therefore it's
likely that a malicious Reader or Writer could acquire the databases without first getting
approval from the monitor.
6. Would you agree that a monitor, as a concurrency mechanism, can support process
synchronization? Why or Why not?
 I agree that the process synchronization of the concurrency mechanism may be
supported by the monitor. In order to achieve mutual exclusion across processes,
programming languages are used by the monitor. The monitor's internal variables are
inaccessible to processes operating outside of the monitor, although they can invoke its
operations.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy