OPER 3600 EXAM 3 QUESTIONS WITH
CORRECT ANSWERS!!
What is a semaphore?
-this is a integer value used for signaling among processes.
What is the difference between a general semaphore and a binary Semaphore?
-A general semaphore can be initialized to a positive integer value. A binary semaphore can only
be initialized to 0 or 1.
-With a general semaphore, the semWait decrements the semaphore value until it becomes
negative. In binary Semaphore, there is no decrement but a simple continue or no continue based
on the value (0 or 1).
What is the problem with weak semaphores?
-it doesn't specify the order in which processes are removed from the queue. Weak semaphores
often lead to starvation.
Why do the SemWait and SemSignal operations have to be atomic?
-because the semaphore variable can only be altered by these two operations, and them being
atomic means they are GUARANTEED to execute.
What is data coherence?
-its where there is uniformity among shared resources of a processes data.
Mutex
-very similar to binary semaphore, except it must be unlocked by the same process that locked it.
, Condition Variable
-a data type that is used to block a process or thread until a condition is met
Monitor
-an abstract data type that encapsulates variables, access procedures and initialization code all
into an abstract data type. Similar to semaphore.
Event Flags
-a memory word used as a synchronization mechanism. It involves a thread checking a flag for
certain bits, and it will be blocked until all the required bits are set to AND or until at least one
bit is set to OR.
Mailbox/Messages
-a way for two processes to exchange info to use for synchronization
Spinlocks
-a mutual exclusion method in which a process goes in an infinite loop waiting for the value of a
lock variable to indicate availability.
Problem/Disadvantage of message passing in regards to the two primitives of send and
receive
-they both rely heavily on synchronization. If there isn't this then it wont work. Among many
processes this can be an issue.
What conditions must be satisfied for the Readers/Writers problem?
CORRECT ANSWERS!!
What is a semaphore?
-this is a integer value used for signaling among processes.
What is the difference between a general semaphore and a binary Semaphore?
-A general semaphore can be initialized to a positive integer value. A binary semaphore can only
be initialized to 0 or 1.
-With a general semaphore, the semWait decrements the semaphore value until it becomes
negative. In binary Semaphore, there is no decrement but a simple continue or no continue based
on the value (0 or 1).
What is the problem with weak semaphores?
-it doesn't specify the order in which processes are removed from the queue. Weak semaphores
often lead to starvation.
Why do the SemWait and SemSignal operations have to be atomic?
-because the semaphore variable can only be altered by these two operations, and them being
atomic means they are GUARANTEED to execute.
What is data coherence?
-its where there is uniformity among shared resources of a processes data.
Mutex
-very similar to binary semaphore, except it must be unlocked by the same process that locked it.
, Condition Variable
-a data type that is used to block a process or thread until a condition is met
Monitor
-an abstract data type that encapsulates variables, access procedures and initialization code all
into an abstract data type. Similar to semaphore.
Event Flags
-a memory word used as a synchronization mechanism. It involves a thread checking a flag for
certain bits, and it will be blocked until all the required bits are set to AND or until at least one
bit is set to OR.
Mailbox/Messages
-a way for two processes to exchange info to use for synchronization
Spinlocks
-a mutual exclusion method in which a process goes in an infinite loop waiting for the value of a
lock variable to indicate availability.
Problem/Disadvantage of message passing in regards to the two primitives of send and
receive
-they both rely heavily on synchronization. If there isn't this then it wont work. Among many
processes this can be an issue.
What conditions must be satisfied for the Readers/Writers problem?