Choose the best threading-synchronization mechanism for each of the following situa- tions:

a) Halting thread execution until a particular event occurs.
b) Allowing access to a critical section only when some event occurs.
c) Restricting access to a critical section.
d) Allowing a set number of threads to access a critical section simultaneously.

a) Halting thread execution until a particular event occurs.
ANS: Events.
b) Allowing access to a critical section only when some event occurs.
ANS: Condition variables.
c) Restricting access to a critical section.
ANS: Locks.
d) Allowing a set number of threads to access a critical section simultaneously.
ANS: Semaphores.

Computer Science & Information Technology

You might also like to view...

DHCPv6 uses which types of address configuration?

a. Stateless address configuration b. Stateful address configuration c. Stateless address configuration and statefuladdress configuration d. None of the above

Computer Science & Information Technology

In a __________, each node contains data plus a pointer to the next node.

a. simple list b. linked list c. array d. table

Computer Science & Information Technology