Abstract
We present a code transformation for concurrent data structures, which increases their scalability without sacrificing correctness. Our transformation takes lock-based code and replaces some of the locking steps therein with optimistic synchronization in order to reduce contention. The main idea is to have each operation perform an optimistic traversal of the data structure as long as no shared memory locations are updated, and then proceed with pessimistic code. The transformed code inherits essential properties of the original one, including linearizability, serializability, and deadlock freedom.
Our work complements existing pessimistic transformations that make sequential code thread-safe by adding locks. In essence, we provide a way to optimize such transformations by reducing synchronization bottlenecks (for example, locking the root of a tree). The resulting code scales well and significantly outperforms pessimistic approaches. We further compare our synthesized code to state-of-the-art data structures implemented by experts. We find that its performance is comparable to that achieved by the custom-tailored implementations. Our work thus shows the promise that automated approaches bear for overcoming the difficulty involved in manually hand-crafting concurrent data structures.
Maya Arbel is supported in part by the Technion Hasso Platner Institute (HPI) Research School.
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
Concurrentskiplistmap from java.util.concurrent. http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentSkipListMap.html
A fast and lightweight key/value database library by google. http://code.google.com/p/leveldb
jmonkeyengine: a 3d game engine for java developers. http://jmonkeyengine.org/
Afek, Y., Attiya, H., Dolev, D., Gafni, E., Merritt, M., Shavit, N.: Atomic snapshots of shared memory. J. ACM 40(4), 873–890 (1993)
Afek, Y., Kaplan, H., Korenfeld, B., Morrison, A., Tarjan, R.E.: CBTree: a practical concurrent self-adjusting search tree. In: Aguilera, M.K. (ed.) DISC 2012. LNCS, vol. 7611, pp. 1–15. Springer, Heidelberg (2012)
Afek, Y., Levy, A., Morrison, A.: Software-improved hardware lock elision. In: PODC (2014)
Aragon, C.R., Seidel, R.: Randomized search trees. In: FOCS, pp. 540–545 (1989)
Arbel, M., Attiya, H.: Concurrent updates with RCU: search tree as an example. In: PODC, pp. 196–205 (2014)
Arbel, M., Golan-Gueta, G., Hillel, E., Keidar, I.: Towards automatic lock removal for scalable synchronization (full version). https://labs.yahoo.com/publications/8476/towards-automatic-lock-removal- scalable-synchronization-full-version
Braginsky, A., Petrank, E.: A lock-free B+tree. In: SPAA, pp. 58–67 (2012)
Bronson, N.G., Casper, J., Chafi, H., Olukotun, K.: A practical concurrent binary search tree. In: PPOPP, pp. 257–268 (2010)
Brown, T., Ellen, F., Ruppert, E.: A general technique for non-blocking trees. In: PPoPP, pp. 329–342 (2014)
Cascaval, C., Blundell, C., Michael, M., Cain, H.W., Wu, P., Chiras, S., Chatterjee, S.: Software transactional memory: Why is it only a research toy? Queue 6(5), 46–58 (2008)
Cherem, S., Chilimbi, T., Gulwani, S.: Inferring locks for atomic sections. In: PLDI (2008)
Crain, T., Gramoli, V., Raynal, M.: A contention-friendly binary search tree. In: Wolf, F., Mohr, B., an Mey, D. (eds.) Euro-Par 2013. LNCS, vol. 8097, pp. 229–240. Springer, Heidelberg (2013)
Cunningham, D., Gudka, K., Eisenbach, S.: Keep off the grass: locking the right path for atomicity. In: Hendren, L. (ed.) CC 2008. LNCS, vol. 4959, pp. 276–290. Springer, Heidelberg (2008)
Dice, D., Harris, T.L., Kogan, A., Lev, Y., Moir, M.: Hardware extensions to make lazy subscription safe (2014). CoRR, abs/1407.6968
Dice, D., Shalev, O., Shavit, N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006)
Doherty, S., Detlefs, D.L., Groves, L., Flood, C.H., Luchangco, V., Martin, P.A., Moir, M., Shavit, N., Steele Jr, G.L.: Dcas is not a silver bullet for nonblocking algorithm design. In: SPAA (2004)
Drachsler, D., Vechev, M.T., Yahav, E.: Practical concurrent binary search trees via logical ordering. In: PPoPP, pp. 343–356 (2014)
Duffy, J.: A (brief) retrospective on transactional memory (2010). http://joeduffyblog.com/2010/01/03/a-brief-retrospective-on-transactional-memory
Ellen, F., Fatourou, P., Ruppert, E., van Breugel, F.: Non-blocking binary search trees. In: PODC, pp. 131–140 (2010)
Emmi, M., Fischer, J.S., Jhala, R., Majumdar, R.: Lock allocation. In: POPL, pp. 291–296 (2007)
Felber, G.K., Shavit, P.N.: Deuce: noninvasive concurrency with a Java STM. In: MULTIPROG (2010)
Fraser, K.: Practical lock-freedom. Ph.D thesis, University of Cambridge (2004)
Golan-Gueta, G., Bronson, N.G., Aiken, A., Ramalingam, G., Sagiv, M., Yahav, E.: Automatic fine-grain locking using shape properties. In: OOPSLA, pp. 225–242 (2011)
Gramoli, V.: More than you ever wanted to know about synchronization: synchrobench, measuring the impact of the synchronization on concurrent algorithms. In: PPoPP (2015)
Gudka, K., Harris, T., Eisenbach, S.: Lock inference in the presence of large libraries. In: Noble, J. (ed.) ECOOP 2012. LNCS, vol. 7313, pp. 308–332. Springer, Heidelberg (2012)
Guerraoui, R., Kapalka, M.: On the correctness of transactional memory. In: PPOPP, pp. 175–184 (2008)
Harris, T., Larus, J., Rajwar, R.: Transactional memory, 2nd edn. Synthesis Lectures on Computer Architecture, vol. 5(1) (2010)
Heller, S., Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N., Shavit, N.: A lazy concurrent list-based set algorithm. In: Anderson, J.H., Prencipe, G., Wattenhofer, R. (eds.) OPODIS 2005. LNCS, vol. 3974, pp. 3–16. Springer, Heidelberg (2006)
Herlihy, M., Lev, Y., Luchangco, V., Shavit, N.: A simple optimistic skiplist algorithm. In: Prencipe, G., Zaks, S. (eds.) SIROCCO 2007. LNCS, vol. 4474, pp. 124–138. Springer, Heidelberg (2007)
Hicks, M., Foster, J.S., Prattikakis, P.: Lock inference for atomic sections. In: Proceedings of the First ACM SIGPLAN Workshop on Languages Compilers, and Hardware Support for Transactional Computing, June 2006
Israeli, A., Rappoport, L.: Disjoint-access-parallel implementations of strong shared memory primitives. In: PODC, pp. 151–160 (1994)
Jin, G., Zhang, W., Deng, D., Liblit, B., Lu, S.: Automated concurrency-bug fixing. In: OSDI (2012)
McCloskey, B., Zhou, F., Gay, D., Brewer, E.: Autolocker: synchronization inference for atomic sections. In: POPL, pp. 346–358 (2006)
McKenney, P.E.: Is parallel programming hard, and if so, what can you do about it?. Linux Technology Center. IBM Beaverton, August 2012
Michael, M.M., Scott, M.L.: Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In: PODC (1996)
Nakaike, T., Michael, M.M.: Lock elision for read-only critical sections in java. In: PLDI, pp. 269–278 (2010)
Natarajan, A., Mittal, N.: Fast concurrent lock-free binary search trees. In: PPoPP, pp. 317–328 (2014)
Rajwar, R., Goodman, J.R.: Transactional lock-free execution of lock-based programs. SIGOPS Oper. Syst. Rev. 36(5), 5–17 (2002)
Roy, A., Hand, S., Harris, T.: A runtime system for software lock elision. In: EuroSys (2009)
Shacham, O.: Verifying Atomicity of Composed Concurrent Operations. Ph.D thesis, Tel Aviv University (2012)
Shacham, O., Bronson, N., Aiken, A., Sagiv, M., Vechev, M., Yahav, E.: Testing atomicity of composed concurrent operations. In: OOPSLA (2011)
Shalev, O., Shavit, N.: Predictive log-synchronization. In: Berbers, Y., Zwaenepoel, W. (eds.) EuroSys, pp. 305–315. ACM (2006)
Zyulkyarov, F., Gajinov, V., Unsal, O.S., Cristal, A., Ayguadé, E., Harris, T., Valero, M.: Atomic quake: using transactional memory in an interactive multiplayer game server. In: ACM Sigplan Notices, vol. 44, pp. 25–34. ACM (2009)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Arbel, M., Golan-Gueta, G., Hillel, E., Keidar, I. (2015). Towards Automatic Lock Removal for Scalable Synchronization. In: Moses, Y. (eds) Distributed Computing. DISC 2015. Lecture Notes in Computer Science(), vol 9363. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-48653-5_12
Download citation
DOI: https://doi.org/10.1007/978-3-662-48653-5_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-48652-8
Online ISBN: 978-3-662-48653-5
eBook Packages: Computer ScienceComputer Science (R0)