Synchronizing without locks is inherently expensive

It has been considered bon ton to blame locks for their fragility, especially since researchers identified obstruction-freedom: a progress condition that precludes locking while being weak enough to raise the hope for good performance. This paper attenuates this hope by establishing lower bounds on the complexity of obstruction-free implementations in contention-free executions: those where obstruction-freedom was precisely claimed to be effective. Through our lower bounds, we argue for an inherent cost of concurrent computing without locks.We first prove that obstruction-free implementations of a large class of objects, using only overwriting or trivial primitives in con-tention-free executions, have Ω(n) space complexity and Ω(log2 n) (obstruction-free) step complexity. These bounds apply to implementations of many popular objects, including variants of fetch&add, counter, compare&swap, and LL/SC. When arbitrary primitives can be applied in contention-free executions, we show that, in any implementation of binary consensus, or any perturbable object, the number of distinct base objects accessed and memory stalls incurred by some process in a contention free execution is Ω(√n). All these results hold regardless of the behavior of processes after they become aware of contention. We also prove that, in any obstruction-free implementation of a perturbable object in which processes are not allowed to fail their operations, the number of memory stalls incurred by some process that is unaware of contention is Ω(n).

[1]  Danny Dolev,et al.  On the minimal synchronism needed for distributed consensus , 1983, 24th Annual Symposium on Foundations of Computer Science (sfcs 1983).

[2]  Nancy A. Lynch,et al.  Impossibility of distributed consensus with one faulty process , 1985, JACM.

[3]  Maurice Herlihy,et al.  Wait-free synchronization , 1991, TOPL.

[4]  Maurice Herlihy,et al.  On the space complexity of randomized synchronization , 1993, PODC '93.

[5]  Brian N. Bershad,et al.  Practical considerations for non-blocking concurrent objects , 1993, [1993] Proceedings. The 13th International Conference on Distributed Computing Systems.

[6]  Anthony LaMarca,et al.  A performance evaluation of lock-free synchronization protocols , 1994, PODC '94.

[7]  Sam Toueg,et al.  Unreliable failure detectors for reliable distributed systems , 1996, JACM.

[8]  Maurice Herlihy,et al.  Contention in shared memory algorithms , 1997, J. ACM.

[9]  Sam Toueg,et al.  Time and Space Lower Bounds for Nonblocking Implementations , 2000, SIAM J. Comput..

[10]  Eric Ruppert Determining Consensus Numbers , 2000, SIAM J. Comput..

[11]  Maurice Herlihy,et al.  Software transactional memory for dynamic-sized data structures , 2003, PODC '03.

[12]  Maurice Herlihy,et al.  Obstruction-free synchronization: double-ended queues as an example , 2003, 23rd International Conference on Distributed Computing Systems, 2003. Proceedings..

[13]  Nir Shavit,et al.  Operation-valency and the cost of coordination , 2003, PODC '03.

[14]  Mark Moir,et al.  On the Uncontended Complexity of Consensus , 2003, DISC.

[15]  William N. Scherer,et al.  Contention Management in Dynamic Software Transactional Memory ∗ , 2004 .

[16]  Nir Shavit,et al.  Linear lower bounds on real-world implementations of concurrent objects , 2005, 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS'05).

[17]  Rachid Guerraoui,et al.  Computing with Reads and Writes in the Absence of Step Contention , 2005, DISC.

[18]  F. Schlenk Proof of Theorem 4 , 2005 .