🤖 AI Summary
Traditional reader-writer locks suffer from coarse-grained contention, making them ill-suited for concurrent data structures involving long-running operations. This work proposes SemanticLock, a synchronization mechanism that generalizes read-write semantics to arbitrary semantic conflict relationships among operations. By constructing an operation conflict graph, SemanticLock enables fine-grained concurrency control while allowing flexible specification of operation semantics. The approach has been integrated into array-based structures supporting both point and range queries, as well as an enhanced ConcurrentHashMap. Experimental results demonstrate that SemanticLock substantially improves concurrency performance under complex, long-duration operations.
📝 Abstract
This paper presents a new lock, SemanticLock, based on the conflict graph between operations. We can consider it a generalization of a read-write lock where conflicts exist between write operations and all other operations. We demonstrate the effectiveness of our lock in two applications. In the first, we design a toy data structure: an array supporting point queries and different range queries. In the second, potentially of greater interest, we augment an existing concurrent data structure, ConcurrentHashMap, with additional long-running operations.