Snapshot-Based Synchronization: A Fast Replacement for Hand-over-Hand Locking

  • Eran GiladEmail author
  • Trevor Brown
  • Mark Oskin
  • Yoav Etsion
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11014)


Concurrent accesses to shared data structures must be synchronized to avoid data races. Coarse-grained synchronization, which locks the entire data structure, is easy to implement but does not scale. Fine-grained synchronization can scale well, but can be hard to reason about. Hand-over-hand locking, in which operations are pipelined as they traverse the data structure, combines fine-grained synchronization with ease of use. However, the traditional implementation suffers from inherent overheads.

This paper introduces snapshot-based synchronization (SBS), a novel hand-over-hand locking mechanism. SBS decouples the synchronization state from the data, significantly improving cache utilization. Further, it relies on guarantees provided by pipelining to minimize synchronization that requires cross-thread communication. Snapshot-based synchronization thus scales much better than traditional hand-over-hand locking, while maintaining the same ease of use.



This research was funded, in part, by Google and the Israel Ministry of Science, Technology, and Space. Trevor Brown was supported in part by the ISF (grants 2005/17 & 1749/14) and by a NSERC post-doctoral fellowship. Eran Gilad was supported by the Hasso-Plattner Institute fellowship.


  1. 1.
    Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., Los Altos (2008)Google Scholar
  2. 2.
    Mellor-Crummey, J.M., Scott, M.L.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Trans. Comput. Syst. 9(1), 21–65 (1991)CrossRefGoogle Scholar
  3. 3.
    Dice, D., Marathe, V.J., Shavit, N.: Lock cohorting: a general technique for designing NUMA locks. In: Symposium on Principles and Practices of Parallel Programming (PPoPP) (2012)Google Scholar
  4. 4.
    Desnoyers, M., McKenney, P.E., Stern, A.S., Dagenais, M.R., Walpole, J.: User-level implementations of read-copy update. IEEE Trans. Parallel Distrib. Syst. 23(2), 375–382 (2012)CrossRefGoogle Scholar
  5. 5.
    Akkan, H., Lang, M., Ionkov, L.: HPC runtime support for fast and power efficient locking and synchronization. In: International Conference on Cluster Computing (2013)Google Scholar
  6. 6.
    Bayer, R., Schkolnick, M.: Concurrency of operations on B-trees. Acta Inform. 9, 1–21 (1977)MathSciNetCrossRefGoogle Scholar
  7. 7.
    Rodeh, O.: B-trees, shadowing, and clones. ACM Trans. Storage 3(4), 2:1–2:27 (2008)CrossRefGoogle Scholar
  8. 8.
    Sánchez, A., Sánchez, C.: A theory of skiplists with applications to the verification of concurrent datatypes. In: Bobaru, M., Havelund, K., Holzmann, G.J., Joshi, R. (eds.) NFM 2011. LNCS, vol. 6617, pp. 343–358. Springer, Heidelberg (2011). Scholar
  9. 9.
    Ohene-Kwofie, D., Otoo, E.J., Nimako, G.: Concurrent operations of O2-tree on shared memory multicore architectures. In: Australasian DB Conference (ADC) (2013)Google Scholar
  10. 10.
    Golan-Gueta, G., Bronson, N., Aiken, A., Ramalingam, G., Sagiv, M., Yahav, E.: Automatic fine-grain locking using shape properties. In: Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (2011)Google Scholar
  11. 11.
    Tamir, O., Morrison, A., Rinetzky, N.: A heap-based concurrent priority queue with mutable priorities for faster parallel algorithms. In: International Conference on Principles of Distributed Systems (OPODIS) (2016)Google Scholar
  12. 12.
    Srinivasan, V., Carey, M.J.: Performance of B+ tree concurrency control algorithms. Very Large Databases J. (JVLDB) 2(4), 361–406 (1993)CrossRefGoogle Scholar
  13. 13.
    Mao, Y., Kohler, E., Morris, R.T.: Cache craftiness for fast multicore key-value storage. In: European Conference on Computer Systems (EUROSYS) (2012)Google Scholar
  14. 14.
    Evangelidis, G., Lomet, D., Salzberg, B.: The hB\(^{\mathit{\Pi }}\)-tree: a multi-attribute index supporting concurrency, recovery and node consolidation. Very Large Databases J. (JVLDB) 6(1), 1–25 (1997)CrossRefGoogle Scholar
  15. 15.
    Jaluta, I., Sippu, S., Soisalon-Soininen, E.: Concurrency control and recovery for balanced B-link trees. Very Large Databases J. (JVLDB) 14(2), 257–277 (2005)CrossRefGoogle Scholar
  16. 16.
    Ellis, C.S.: Distributed data structures: a case study. IEEE Trans. Comput. 34, 1178–1185 (1985)CrossRefGoogle Scholar
  17. 17.
    Gilad, E., Mayzels, T., Raab, E., Oskin, M., Etsion, Y.: Towards a deterministic fine-grained task ordering using multi-versioned memory. In: Computer Architecture and High Performance Computing (SBAC-PAD) (2017)Google Scholar
  18. 18.
    Attiya, H., Ramalingam, G., Rinetzky, N.: Sequential verification of serializability. In: Symposium on Principles of Programming Languages (POPL) (2010)Google Scholar
  19. 19.
    Vafeiadis, V., Herlihy, M., Hoare, T., Shapiro, M.: Proving correctness of highly-concurrent linearisable objects. In: Symposium on Principles and Practices of Parallel Programming (PPoPP) (2006)Google Scholar
  20. 20.
    Tullsen, D.M., Lo, J.L., Eggers, S.J., Levy, H.M.: Supporting fine-grained synchronization on a simultaneous multithreading processor. In: Symposium on High-Performance Computer Architecture (HPCA) (1999)Google Scholar
  21. 21.
    Zhu, W., Sreedhar, V.C., Hu, Z., Gao, G.R.: Synchronization state buffer: supporting efficient fine-grain synchronization on many-core architectures. In: International Symposium on Computer Architecture (ISCA) (2007)Google Scholar
  22. 22.
    Yan, J., Tan, G., Zhang, X., Yao, E., Sun, N.: vLock: lock virtualization mechanism for exploiting fine-grained parallelism in graph traversal algorithms. In: International Symposium on Code Generation and Optimization (CGO) (2013)Google Scholar
  23. 23.
    Dice, D., Shalev, O., Shavit, N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006). Scholar
  24. 24.
    Segulja, C., Abdelrahman, T.: Architectural support for synchronization-free deterministic parallel programming. In: Symposium on High-Performance Computer Architecture (HPCA) (2012)Google Scholar
  25. 25.
    Gilad, E., Mayzels, T., Raab, E., Oskin, M., Etsion, Y.: Architectural support for unlimited memory versioning and renaming. In: International Parallel and Distributed Processing Symposium (IPDPS) (2018)Google Scholar

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  • Eran Gilad
    • 1
    Email author
  • Trevor Brown
    • 2
  • Mark Oskin
    • 3
  • Yoav Etsion
    • 1
  1. 1.Technion – Israel Institute of TechnologyHaifaIsrael
  2. 2.Institute of Science and TechnologyKlosterneuburgAustria
  3. 3.University of WashingtonSeattleUSA

Personalised recommendations