1. Briefly explain the differences between a semaphore and a
condition variable, and what problem in...
1. Briefly explain the differences between a semaphore and a
condition variable, and what problem in common these two
synchronization primitives solve.
Solutions
Expert Solution
Semaphores and condition variables both try to solve
synchronisation problems. There are situations when we want a
resource to be accessible by only one process or some processes or
by processes in a certain order. These concepts solve the problems
that may arise.
Condition variable provides a queue for processes which are
waiting for some resource to access or acquire. When a process
wants to access some resource, it tests a condition, if it is true,
it uses it, otherwise it adds itself to the queue and waits for its
turn. When a process finishes its turn, it wakes up exactly one
process waiting in the queue for the resource. If the queue is
empty, it does nothing. There is also a broadcast signal mechanism
which wakes up all the processes waiting in case of a shareable
resource. Only three operations are defined in case of a condition
variable: wait, signal and broadcast signal.
A semaphore is an integer variable which can be initialized to
a certain value. But, this value can be changed by only two atomic
operations P(x) and W(x). It may provide service like controlled
access to the critical section or some resource. P(x) operation
checks the value of x, if x>=0, then it decrements x by one and
starts executing the critical section, otherwise it becomes
blocked. When a process has finished executing the critical section
or is done with the resource it executes W(x) which increments the
value of x by one. This increment in x will unblock one process
which has been blocked by the semaphore. Semaphore can be counting
semaphore where it can take more than 2 values, or binary semaphore
where it can take only 2 values: 0 and 1.
Briefly explain the following concepts.
a. What is the difference between “variable” and “random
variable”?
b. Give two real life examples, one would be appropriate for
binomial distribution and the other
would for Poisson distribution.
c. Explain why binomial distribution is related to the selection of
“with replacement” NOT
“without replacement”.
d. In what situation normal probability rule can be used to obtain
binomial probability? How
would you evaluate the appropriateness of this rule?
Briefly explain what are coastal engineering structures and the
differences between the two categories.
Provide a brief history of the structure Ripraps and
Gabions (including its category)
How widely is the structure used?
(a) How does the electron microscopy work? Explain briefly
(b) What are the differences between Scanning Electron
Microscopy (SEM) and Transmission Electron Microscopy (TEM)?
Briefly answer the followings.
a. Explain the differences between probability distribution and
sampling distribution.
b. What is the main difference of probability calculation between
discrete and continuous random
variables?
c. Compare the characteristics of a t distribution and the standard
normal distribution.
d. What do you understand by the statement “The probability density
function of a normal
distribution is symmetric.