Abstract
In a synchronous queue, producers and consumers handshake to exchange data. Recently, new scalable unfair synchronous queues were added to the Java JDK 6.0 to support high performance thread pools.
This paper applies flat-combining to the problem of designing a synchronous queue algorithm. We first use the original flat-combining algorithm, a single “combiner” thread acquires a global lock and services the other threads’ combined requests with very low synchronization overheads. As we show, this single combiner approach delivers superior performance up to a certain level of concurrency, but unfortunately does not continue to scale beyond that point.
In order to continue to deliver scalable performance as concurrency increases, we introduce a new parallel flat-combining algorithm. The new algorithm dynamically adds additional concurrently executing flat-combiners that coordinate their work. It enjoys the low coordination overheads of sequential flat combining, with the added scalability that comes with parallelism.
Our novel unfair synchronous queue using parallel flat combining exhibits scalability far and beyond that of the JDK 6.0 algorithm: it matches it in the case of a single producer and consumer, and is superior throughout the concurrency range, delivering up to 11 (eleven) times the throughput at high concurrency.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Afek, Y., Korland, G., Natanzon, M., Shavit, N.: Scalable producer-consumer pools based on elimination-diffraction trees. In: Euro-Par ’10 (June 2010) (to appear)
Attiya, H., Bar-Noy, A., Dolev, D., Peleg, D., Reischuk, R.: Renaming in an asynchronous environment. J. ACM 37(3), 524–548 (1990)
Hanson, D.R.: C interfaces and implementations: techniques for creating reusable software. Addison-Wesley Longman Publishing Co., Inc., Boston (1996)
Hendler, D., Incze, I., Shavit, N., Tzafrir, M.: Flat combining and the synchronization-parallelism tradeoff. In: SPAA ’10: Proceedings of the Twenty Third annual ACM Symposium on Parallelism in Algorithms and Architectures, pp. 355–364 (2010)
Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann, NY (2008)
Lea, D.: util.concurrent.ConcurrentHashMap in java.util.concurrent the Java Concurrency Package, http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/-src/main/java/util/concurrent/
Scherer III, W.N., Lea, D., Scott, M.L.: Scalable synchronous queues. ACM Commun. 52(5), 100–111 (2009)
Scherer III., W.N.: Synchronization and concurrency in user-level software systems. PhD thesis, Rochester, NY, USA, Adviser-Scott, Michael L (2006)
Scherer III, W.N., Scott, M.L.: Nonblocking concurrent data structures with condition synchronization. In: Guerraoui, R. (ed.) DISC 2004. LNCS, vol. 3274, pp. 174–187. Springer, Heidelberg (2004)
Shavit, N., Touitou, D.: Elimination trees and the construction of pools and stacks. Theory of Computing Systems 30, 645–670 (1997)
Shavit, N., Zemach, A.: Diffracting trees. ACM Trans. Comput. Syst. 14(4), 385–428 (1996)
Treiber, R.K.: Systems programming: Coping with parallelism. Technical Report RJ 5118, IBM Almaden Research Center (April 1986)
Tzafrir, M.: C++ multi-platform memory-model solution with java orientation, http://groups.google.com/group/cpp-framework
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hendler, D., Incze, I., Shavit, N., Tzafrir, M. (2010). Scalable Flat-Combining Based Synchronous Queues. In: Lynch, N.A., Shvartsman, A.A. (eds) Distributed Computing. DISC 2010. Lecture Notes in Computer Science, vol 6343. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-15763-9_8
Download citation
DOI: https://doi.org/10.1007/978-3-642-15763-9_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-15762-2
Online ISBN: 978-3-642-15763-9
eBook Packages: Computer ScienceComputer Science (R0)