Question

Explain how asynchronous thread cancellation differs from deferred thread cancellation.

Explain how asynchronous thread cancellation differs from deferred thread cancellation.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Thread cancellation is a process in which a thread is terminated prior to it's completion.For instance if there are multiple threads performing a search operation and one of those threads returns the result then the remaining threads can be terminated to optimize the performance of the system.

The thread which is to be cancelled is termed as the target thread.There are mainly two different cancellation methods

  • Asynchronous Thread Cancellation :-
  1. It is the process in which a the target thread is immediately terminated .
  2. The thread gets abruptly terminated.
  3. Cancellation of thread asynchronously may not free all the necessary resources allocated to that thread.
  4. Asynchronous Cancellation can occur at any time.
  • Deferred Thread Cancellation:-
  1. It is a process in which the target thread periodically makes a check whether it should terminate itself.
  2. It provides an opportunity so that the thread can be terminated in orderly fashion.
  3. During Deferred Thread Cancellation a cleanup handler releases all the acquired resources of the thread before it is terminated.
  4. Deferred Cancellation can occur only at defined points.
Add a comment
Know the answer?
Add Answer to:
Explain how asynchronous thread cancellation differs from deferred thread cancellation.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT