In ________, a cancellation request may take effect without waiting for the…
2018
In ________, a cancellation request may take effect without waiting for the target thread to reach a cancellation point.
Answer: A. Asynchronous cancellation — ConceptThread cancellation uses a cancellation state and a cancellation type to control whether and when a pending request takes effect. With asynchronous…
- A.
Asynchronous cancellation
- B.
Synchronous cancellation
- C.
Deferred cancellation
- D.
Both deferred and asynchronous cancellation
Attempted by 519 students.
Show answer & explanation
Correct answer: A
Concept
Thread cancellation uses a cancellation state and a cancellation type to control whether and when a pending request takes effect.
With asynchronous cancellation, the request may be acted on at any time. With deferred cancellation, it remains pending until the target reaches a defined cancellation point.
Application
The stem says the request need not wait for the target thread to reach a cancellation point.
That timing rule is the defining behavior of asynchronous cancellation.
Therefore, the blank is filled by “asynchronous cancellation.”
Contrast and cross-check
Synchronous cancellation is not one of the two POSIX cancellation types; it suggests a coordinated request-response action.
Deferred cancellation waits for the target to reach a cancellation point.
“Both deferred and asynchronous cancellation” combines two distinct timing policies instead of naming the single policy described.
Cross-check: POSIX defines the two cancellation types as asynchronous and deferred, and the at-any-time behavior belongs to the asynchronous type.
A video solution is available for this question — log in and enroll to watch it.