Chapter 9. Cancellation

  • What Cancellation Is

  • INTERRUPT()

  • A Cancellation Example

  • Using Cancellation

  • Cleanup

  • Implementing EnableInterrupts()

  • A Cancellation Example (Improved)

  • Simple Polling

  • APIs Used in this Chapter

  • The Class java.lang.Thread

  • The Class Extensions.InterruptibleThread

In which we describe the acrimonious nature of some programs and how unwanted threads may be disposed of. The highly complex issues surrounding bounded time termination and program correctness are also covered. A simple conclusion is drawn.

What Cancellation Is

Sometimes you have reason to get rid of a thread before it has completed its work. Perhaps the user changed her mind about what she was doing. Perhaps the program had many threads doing a heuristic search, and one of them ...

Get Multithreaded Programming with JAVA™ Technology now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.