Interrupting snapshots and the Java™ size method

Yehuda Afek*, Nir Shavit, Moran Tzafrir

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review


The Java developers kit requires a size() operation for all objects. Unfortunately, the best known solution, available in the Java concurrency package, has a blocking concurrent implementation that does not scale. This paper presents a highly scalable wait-free implementation of a concurrent size() operation based on a new lock-free interrupting snapshots algorithm for the classical atomic snapshot problem. This is perhaps the first example of the potential benefit from using atomic snapshots in real industrial code (the concurrency package is currently deployed on over 10 million desktops). The key idea behind the new algorithm is to allow snapshot scans to interrupt each other until they agree on a shared linearization point with respect to updates, rather than trying, as was done in the past, to have them coordinate the collecting of a shared global view. As we show, the new algorithm scales well, significantly outperforming existing implementations.

Original languageEnglish
Title of host publicationDistributed Computing - 23rd International Symposium, DISC 2009, Proceedings
Number of pages15
StatePublished - 2009
Event23rd International Symposium on Distributed Computing, DISC 2009 - Elche, Spain
Duration: 23 Sep 200925 Sep 2009

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume5805 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Conference23rd International Symposium on Distributed Computing, DISC 2009


  • Atomic
  • Consistent state
  • Fault-tolerance
  • Global state
  • Snapshot


Dive into the research topics of 'Interrupting snapshots and the Java™ size method'. Together they form a unique fingerprint.

Cite this