Quicksort: Combining Concurrency, Recursion, and Mutable Data Structures

David Kitchin, Adrian Quark, Jayadev Misra. Quicksort: Combining Concurrency, Recursion, and Mutable Data Structures. In Reflections on the Work of C.A.R. Hoare. pages 229-254, Springer, 2010. [doi]

Abstract

Quicksort remains one of the most studied algorithms in computer science. It is important not only as a practical sorting method, but also as a splendid teaching aid for introducing recursion and systematic algorithm development. The algorithm has been studied extensively; so, it is natural to assume that everything that needs to be said about it has already been said. Yet, in attempting to code it using a recent programming language of our design, we discovered that its structure is more clearly expressed as a concurrent program that manipulates a shared mutable store, without any locking or explicit synchronization. In this paper, we describe the essential aspects of our programming language Orc, show a number of examples that combine its features in various forms, and then develop a concise description of Quicksort. We hope to highlight the importance of including concurrency, recursion and mutability within a single theory.