Question: The int sem _ trywait ( sem _ t * sem ) operation blocks if ( a ) the semaphore value > 0 (
The "int semtrywait semt sem operation blocks if
a the semaphore value
b the semaphore value
c it never blocks
d None of the above
Which of the following CORRECT about the seminit function shown below.
int seminitsemt sem int pshared, unsigned int value;
a It is used to initialize both named and unnamed semaphores and to assign the value
specified by the "value" parameter to the semaphore.
b It is used to initialized named semaphores only and to assign the value specified by the
"value" parameter to the semaphore.
c the pshared variable is used to specify whether the semaphore can be used within the
calling process only or it can be used by multiple processes.
db and c
e None of the above
In the pseudocode blow, what initial values of the semaphores and will cause the two pro
cesses to alternate in executing their printf statements such that the output is A B A B A B A B
a
b
c
d
e None of the above
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
