Toilers in the orchards of multi-threaded programming can only reap the fruits of concurrent execution through the hard work of access synchronization. This paper describes the jThread library, designed to simplify correct synchronization and enhance concurrency. The library extracts modest execution costs that would most likely be covered by reliable and improved concurrent performance.
The library’s basic mechanism is the mutex, and its basic policy is to prevent and avoid deadlocks. Group locking provides prevention: all necessary mutexes are acquired at the same time, or none are. Because determining necessary mutexes may be difficult or impossible in dynamic or modular environments, the library provides regions as an abstraction of necessary mutex groups. A variant of Lamport’s bakery algorithm manages competition among regions. The appendices provide a formal definition of jThread mechanisms and a proof of non-starvation. The library has been implemented in a shared-store, multi-threaded scheme variant, and is applicable to host languages--Java, for example--without gotos and with block-structured critical sections.
Acquisition micro-benchmarks show jThread operations are from three to 50 times more expensive than basic mutex operations, which is not surprising given jThread operation complexity. Slightly more involved micro-benchmarks show essentially identical performance between jThread and basic mutexes. Comparisons between production code (web servers and MP3 players) show similar results.
Readers should have some familiarity with concurrency control in programming languages and operating systems. The bibliography is necessarily selective and surprisingly eclectic, but nevertheless relevant. The paper is well written and reads smoothly, for the most part.