How to Cancel a Task
Task parallelism is ubiquitous in modern applications for event-based, distributed, or reactive systems. In this type of programming, the ability to cancel a running task arises as a critical feature. Although there are a variety of cancellation techniques, a comprehensive account of their characteristics is missing. This paper provides a classification of task cancellation patterns, as well as a detailed analysis of their advantages and disadvantages. One promising approach is cooperative cancellation, where threads must be continuously prepared for external cancellation requests. Based on this pattern, we propose an extension of SCOOP, an object-oriented concurrency model.
KeywordsException Handling Task Parallelism Cancellation Technique Task Cancellation Cancellation Mechanism
Unable to display preview. Download preview PDF.
- 1.Albahari, J., Albahari, B.: C# 3.0 in a Nutshell: A Desktop Quick Reference. O’Reilly Media, Incorporated (2007)Google Scholar
- 2.Baker Jr, H.C., Hewitt, C.: The incremental garbage collection of processes. In: Artificial Intelligence and Programming Languages, pp. 55–59. ACM (1977)Google Scholar
- 3.Concurrent futures in Python (2013), http://docs.python.org/dev/library/concurrent.futures.html
- 5.Destroying Threads in C# (2013), http://msdn.microsoft.com/en-us/library/cyayh29d.aspx
- 6.Hyde, P.: Java thread programming. Sams Pub. (1999)Google Scholar
- 7.Leijen, D., Schulte, W., Burckhardt, S.: The design of a task parallel library. In: OOPSLA 2009, pp. 227–242. ACM (2009)Google Scholar
- 8.Meyer, B.: Object-Oriented Software Construction, 2nd edn. Prentice-Hall (1997)Google Scholar
- 9.Morandi, B., Nanz, S., Meyer, B.: Who is accountable for asynchronous exceptions? In: APSEC 2012, pp. 462–471. IEEE Computer Society (2012)Google Scholar
- 10.Nienaltowski, P.: Practical framework for contract-based concurrent object-oriented programming. Ph.D. thesis, ETH Zurich (2007)Google Scholar
- 11.Peierls, T., Goetz, B., Bloch, J., Bowbeer, J., Lea, D., Holmes, D.: Java Concurrency in Practice. Addison-Wesley (2005)Google Scholar
- 12.POSIX threads specification (2013), http://man7.org/linux/man-pages/man7/pthreads.7.html
- 13.Scala Scheduler (2013), http://doc.akka.io/docs/akka/snapshot/scala/scheduler.html