Abstract
We present a new design and a C++ implementation of a high-performance, cache-efficient hash table suitable for use in implementation of parallel programs in shared memory. Among the main design criteria were the ability to efficiently use variable-length keys, dynamic table resizing to accommodate data sets of unpredictable size and fully concurrent read-write access.
We show that the design is correct with respect to data races, both through a high-level argument, as well as by using a model checker to prove crucial safety properties of the actual implementation. Finally, we provide a number of benchmarks showing the performance characteristics of the C++ implementation, in comparison with both sequential-access and concurrent-access designs.
This work has been partially supported by the Czech Science Foundation grant No. 15-08772S.
P. Ročkai has been partially supported by Red Hat, Inc.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
The C++ source code for the hash table implementation can be found online: https://divine.fi.muni.cz/trac/browser/bricks/brick-hashset.h#L481.
- 2.
Doubts could arise when using a model checker which uses the hash table to be verified internally. An analysis of failure modes of the hash table along with the properties of the model checking algorithm indicate that this could not cause the model checker to miss a valid counterexample. Nonetheless, the entire issue is easy to side-step by using a much simpler sequential hash table and just waiting longer for the result.
- 3.
The code can be found online at https://divine.fi.muni.cz/trac/browser/examples/llvm/hashset.cpp.
- 4.
An extension to gdb to record execution exists, but we were unable to use it successfully. Either the window in which time reversal was possible was too narrow, or the memory and time requirements too high.
- 5.
The full data set will be eventually published online, but is too extensive to fit in a paper. Please check http://divine.fi.muni.cz/benchmarks.
- 6.
References
Intel Corporation, Threading Building Blocks (2014–06-01) (2014). http://www.threadingbuildingblocks.org
Shalev, O., Shavit, N.: Split-ordered lists: lock-free extensible hashtables. J. ACM 53(3), 379–405 (2006). http://doi.acm.org/10.1145/1147954.1147958
Laarman, A.W., van de Pol, J.C., Weber, M.: Boosting multi-core reachability performance with shared hash tables. In: Sharygina, N., Bloem, R. (eds.) FMCAD 2010. IEEE Computer Society, Los Alamitos (2010)
Purcell, C., Harris, T.: Non-blocking hashtables with open addressing. In: Proceedings of the 19th International Symposium on Distributed Computing, DISC 2005, September 2005, a longer version appears as Technical report UCAM-CL-TR-639. http://research.microsoft.com/apps/pubs/default.aspx?id=67422
Gao, H., Groote, J.F., Hesselink, W.H.: Lock-free dynamic hash tables with open addressing. Distrib. Comput. 18(1), 21–42 (2005)
Wijs, A., Bošnački, D.: Many-core on-the-fly model checking of safety properties using GPUs. Int. J. Softw. Tools Technol. Transf. 1–17 (2015) (to appear)
Jenkins, R.J.: A hash function for hash table lookup (2006). http://burtleburtle.net/bob/hash/doobs.html
Jenkins, R.J.: SpookyHash: a 128-bit Noncryptographic Hash (2012). http://burtleburtle.net/bob/hash/spooky.html
Pike, G., Alakuijala, J.: Introducing CityHash (2011)
Batagelj, V.: The quadratic hash method when the table size is not a primenumber. Commun. ACM 18(4), 216–217 (1975). http://doi.acm.org/10.1145/360715.360737
Ročkai, P., Šill, V., Barnat, J.: Techniques for memory-efficient model checking of C and C++ code. In: Software Engineering and Formal Methods (2015, submitted)
Fagin, R., Nievergelt, J., Pippenger, N., Strong, H.R.: Extendible hashing—a fast access method for dynamic files. ACM Trans. Database Syst. 4(3), 315–344 (1979)
Barnat, J., et al.: DiVinE 3.0 – anexplicit-state model checker for multithreaded C & C++ programs. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 863–868. Springer, Heidelberg (2013)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Barnat, J., Ročkai, P., Štill, V., Weiser, J. (2015). Fast, Dynamically-Sized Concurrent Hash Table. In: Fischer, B., Geldenhuys, J. (eds) Model Checking Software. SPIN 2015. Lecture Notes in Computer Science(), vol 9232. Springer, Cham. https://doi.org/10.1007/978-3-319-23404-5_5
Download citation
DOI: https://doi.org/10.1007/978-3-319-23404-5_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-23403-8
Online ISBN: 978-3-319-23404-5
eBook Packages: Computer ScienceComputer Science (R0)