Question

In: Computer Science

If the value of semaphore is negative, ___? A. an increment operation can be perform on...

If the value of semaphore is negative, ___?

A. an increment operation can be perform on it.

B. a process is waiting forever.

C. there will be no process waiting on that semaphore.
D. a decrement can be perform on it.

((( ( can negative semaphore decreases in case of more waiting processes? Explain in details. )))

Solutions

Expert Solution

If the value of semaphore is negative.......

B)A process is waiting forever.

Explaination:

If the semaphore value is negative, then the processes came for the execution on that semaphore will be blocked in waiting state. Semaphores are used for the process which are under the critical section problems that means process at which they have to share resources. The only possible values of semaphore is 0 and 1 in case of binary semaphore otherwise the semaphore value should be greater than or equal to 0. There will be 2 values for the semaphore variable. one is wait that allows the process to not allow into critical section when the other process is in critical section. The other is signal that means giving access for the processes to enter into the critical section. These two operations will possible only if the semaphore value is 0 or 1 respectively. Otherwise all processes that goes under that paricular semaphore which is having a negative value will wait for that semaphores signal. And that semaphore will unable to give access to the process at any moment. So we can say that If the value of the semaphore is negative, Then A process is waiting forever.

                     Hope the above is helpful. Please feel free to comment if any queries in the

                                 comment section. I will try to solve them as soon as possible.

                                            Do an up vote. Thank you...


Related Solutions

Question on Database Systems - Concurrency Control A popular update operation is increment/decrement the numeric value...
Question on Database Systems - Concurrency Control A popular update operation is increment/decrement the numeric value of data object by 1. Suppose we are now to create a lock mode I, along with usual shared and exclusive lock modes. Consider a locking protocol that will require a request for a lock with mode I on a data object Q (with numeric value) before proceeding with the increment/decrement operation on Q. (i) Provide a lock compatibility matrix with these three modes....
Explain the difference between truncation and rounding.How can one operation be made to perform the function...
Explain the difference between truncation and rounding.How can one operation be made to perform the function of the other?
Can a nuclear decay reaction have a negative Q value?
Can a nuclear decay reaction have a negative Q value?
If the magnification is negative value a. The image is upright b. The image can be...
If the magnification is negative value a. The image is upright b. The image can be either upright or upside down c. The image is upside down d. The image size is reduced
-Does it make sense for a company's first month of operation to have: negative operation activities,...
-Does it make sense for a company's first month of operation to have: negative operation activities, investing activities and positive financing activities? why? -The same company has an EPS of 0.2, what does that mean for the company's performance?
A machine, currently in operation, has a market value of $4000. The machine can still be...
A machine, currently in operation, has a market value of $4000. The machine can still be used over the next three years, but its market value will become $3000, $2500, $2,000 at the end of the first, second, and third years, respectively. The operating expenses of the machine amount to $20,000 during the first year, and will increase by $5,000 each year thereafter. This machine can be replaced by a newer model, which cost $30,000 for installation and will have...
1. A group of doctors is deciding whether or not to perform an operation. Suppose the...
1. A group of doctors is deciding whether or not to perform an operation. Suppose the null hypothesis, H0, is: the surgical procedure will go well. State the Type I and Type II errors in complete sentences, and explain which is the error with the greater consequence and why. 2. An article posted on your college's website claims that 12% of the students at the school use marijuana. You randomly sample 140 students, and 12 students reply that they do...
Can an eccentricity be negative?
Can an eccentricity be negative?
A negative Rational could either be represented by a negative value stored in __numerator or a...
A negative Rational could either be represented by a negative value stored in __numerator or a negative value stored in __denominator. If negative values are stored in both, the reduce() method that is provided for you will make them both positive. If a Rational happens to reduce to a whole number, it will still be saved in Rational form. In other words, if the result of an add() call creates a fraction 6/2, it should reduce to 3/1 but will...
10. An F value can never be negative. True or False 9. You use a different...
10. An F value can never be negative. True or False 9. You use a different table to compute critical values for t-tests and ANOVAs. True or False 8. Degrees of freedom for chi-squared tests are determined by sample size. True or False 7. If a correlation between two variables is negative, that means there is no linear relationship between them. True or False 6. Parametric tests usually have more statistical power than non-parametric tests. True or False 5. A...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT