Scalable synchronous queues

  • Authors:
  • William N. Scherer, III;Doug Lea;Michael L. Scott

  • Affiliations:
  • Rice University, Houston, TX;SUNY Oswego, Oswego, NY;University of Rochester, Rochester, NY

  • Venue:
  • Communications of the ACM - Security in the Browser
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

In a thread-safe concurrent queue, consumers typically wait for producers to make data available. In a synchronous queue, producers similarly wait for consumers to take the data. We present two new nonblocking, contention-free synchronous queues that achieve high performance through a form of dualism: The underlying data structure may hold both data and, symmetrically, requests. We present performance results on 16-processor SPARC and 4-processor Opteron machines. We compare our algorithms to commonly used alternatives from the literature and from the Java SE 5.0 class java.util.concurrent.SynchronousQueue both directly in synthetic microbenchmarks and indirectly as the core of Java's ThreadPoolExecutor mechanism. Our new algorithms consistently outperform the Java SE 5.0 SynchronousQueue by factors of three in unfair mode and 14 in fair mode; this translates to factors of two and ten for the ThreadPoolExecutor. Our synchronous queues have been adopted for inclusion in Java 6.