Deferred cancellation: a behavioral pattern

  • Authors:
  • Philipp Bachmann

  • Affiliations:
  • Institute for Medical Informatics and Biostatistics, Basel, BS, Switzerland

  • Venue:
  • Proceedings of the 15th Conference on Pattern Languages of Programs
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

People who design their own pool of worker threads [33, pp 290--298] or processes have to consider how to shut down the workers again or how to dynamically adapt the number of workers to varying load. Especially with regard to application termination you may have the choice between an immediate destruction of the pool and a more graceful shutdown. The pattern proposed helps to portably implement such termination and load adaptation mechanisms that assume you voted for the second choice. The main area of application are the internals of active objects [40] and similar designs that delegate work to a pool of threads or processes to execute service requests asynchronously from their actual invocation. For the pattern proposed we identified usage examples in popular existing applications or libraries. Both a real world example and sample code accompany the pattern presentation. This sample code is in C++. The presentation of the pattern follows the style well known from [11] and [44]. This pattern is based upon other patterns. Typographic conventions for references to other patterns are similar to [3]. A Glossary provides thumbnails of many of these patterns.