Skip to main content

Concurrent Correctness in Vector Space

  • Conference paper
  • First Online:
Verification, Model Checking, and Abstract Interpretation (VMCAI 2021)

Abstract

Correctness verification of a concurrent history is challenging and has been proven to be an NP-complete problem. The reason that verifying correctness cannot be solved in polynomial time is a consequence of the way correctness is defined. Traditional correctness conditions require a concurrent history to be equivalent to a legal sequential history. The worst case number of legal sequential histories for a concurrent history is O(n!) with respect to n methods invoked. Existing correctness verification tools improve the time complexity by either reducing the size of the possible legal sequential histories or improving the efficiency of generating the possible legal sequential histories. Further improvements to the time complexity of correctness verification can be achieved by changing the way correctness of concurrent programs is defined. In this paper, we present the first methodology to recast the correctness conditions in literature to be defined in vector space. The concurrent histories are represented as a set of method call vectors, and correctness is defined as properties over the set of vectors. The challenge with defining correctness in vector space is accounting for method call ordering and data structure semantics. We solve this challenge by incorporating a priority assignment scheme to the values of the method call vectors. Using our new definitions of concurrent correctness, we design a dynamic analysis tool that checks the vector space correctness of concurrent data structures in \(O(n^2)\) with respect to n method calls, a significant improvement over O(n!) time required to analyze legal sequential histories. We showcase our dynamic analysis tool by using it to check the vector space correctness of a variety of queues, stacks, and hashmaps.

This work was funded by NSF grants 1740095 and 1717515.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
eBook
USD 79.99
Price excludes VAT (USA)
Softcover Book
USD 99.99
Price excludes VAT (USA)

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Afek, Y., Korland, G., Yanovsky, E.: Quasi-linearizability: relaxed consistency for improved concurrency. In: Lu, C., Masuzawa, T., Mosbah, M. (eds.) OPODIS 2010. LNCS, vol. 6490, pp. 395–410. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-17653-1_29

    Chapter  Google Scholar 

  2. Alur, R., McMillan, K., Peled, D.: Model-checking of correctness conditions for concurrent objects. In: Proceedings 11th Annual IEEE Symposium on Logic in Computer Science, pp. 219–228. IEEE (1996)

    Google Scholar 

  3. Amit, D., Rinetzky, N., Reps, T., Sagiv, M., Yahav, E.: Comparison under abstraction for verifying linearizability. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 477–490. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73368-3_49

    Chapter  Google Scholar 

  4. Aspnes, J., Herlihy, M., Shavit, N.: Counting networks. J. ACM (JACM) 41(5), 1020–1048 (1994)

    Article  MathSciNet  Google Scholar 

  5. Boost: Boost c++ library (2019). https://www.boost.org/

  6. Bouajjani, A., Emmi, M., Enea, C., Hamza, J.: Verifying concurrent programs against sequential specifications. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 290–309. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37036-6_17

    Chapter  Google Scholar 

  7. Bouajjani, A., Emmi, M., Enea, C., Hamza, J.: Tractable refinement checking for concurrent objects. In: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2015), vol. 50, no. 1, pp. 651–662 (2015)

    Google Scholar 

  8. Burckhardt, S., Dern, C., Musuvathi, M., Tan, R.: Line-up: a complete and automatic linearizability checker. In: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2010) vol. 45, no.6, pp. 330–340 (2010)

    Google Scholar 

  9. Burnim, J., Elmas, T., Necula, G., Sen, K.: Ndseq: Runtime checking for nondeterministic sequential specifications of parallel correctness. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11), vol. 46, pp. 401–414. ACM (2011)

    Google Scholar 

  10. Cook, V., Peterson, C., Painter, Z., Dechev, D.: Quantifiability: Concurrent correctness from first principles. arXiv preprint arXiv:1905.06421 (2019)

  11. Doolan, P., Smith, G., Zhang, C., Krishnan, P.: Improving the scalability of automatic linearizability checking in SPIN. In: Duan, Z., Ong, L. (eds.) ICFEM 2017. LNCS, vol. 10610, pp. 105–121. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-68690-5_7

    Chapter  Google Scholar 

  12. Elmas, T., Tasiran, S.: Vyrdmc: driving runtime refinement checking with model checkers. Electron. Notes Theor. Comput. Sci. 144(4), 41–56 (2006)

    Article  Google Scholar 

  13. Elmas, T., Tasiran, S., Qadeer, S.: Vyrd: verifying concurrent programs by runtime refinement-violation detection. In: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation (PLDI 2005), vol. 40, pp. 27–37. ACM (2005)

    Google Scholar 

  14. Emmi, M., Enea, C.: Sound, complete, and tractable linearizability monitoring for concurrent collections. In: Proceedings of the ACM on Programming Languages, vol. 2(POPL), p. 25 (2017)

    Google Scholar 

  15. Emmi, M., Enea, C., Hamza, J.: Monitoring refinement via symbolic reasoning. In: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2015), vol. 50, pp. 260–269. ACM (2015)

    Google Scholar 

  16. Feldman, S., LaBorde, P., Dechev, D.: Tervel: A unification of descriptor-based techniques for non-blocking programming. In: 2015 International Conference on Embedded Computer Systems: Architectures, Modeling, and Simulation (SAMOS), pp. 131–140. IEEE (2015)

    Google Scholar 

  17. Flanagan, C., Flanagan, C., Freund, S.N.: Atomizer: a dynamic atomicity checker for multithreaded programs. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2004), vol. 39, pp. 256–267. ACM (2004)

    Google Scholar 

  18. Flanagan, C., Freund, S.N., Yi, J.: Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2008) 43(6), 293–303 (2008)

    Google Scholar 

  19. Gibbons, P.B., Korach, E.: Testing shared memories. SIAM J. Comput. 26(4), 1208–1244 (1997)

    Article  MathSciNet  Google Scholar 

  20. Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann. Revised Reprint. ISBN: 0123973375, August 2012

    Google Scholar 

  21. Herlihy, M.P., Wing, J.M.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. (TOPLAS) 12(3), 463–492 (1990)

    Article  Google Scholar 

  22. Horn, A., Kroening, D.: Faster linearizability checking via P-compositionality. In: Graf, S., Viswanathan, M. (eds.) FORTE 2015. LNCS, vol. 9039, pp. 50–65. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19195-9_4

    Chapter  Google Scholar 

  23. Intel: Intel thread building blocks (2019). https://www.threadingbuildingblocks.org/

  24. Kirsch, C.M., Lippautz, M., Payer, H.: Fast and scalable, lock-free k-FIFO queues. In: Malyshkin, V. (ed.) PaCT 2013. LNCS, vol. 7979, pp. 208–223. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39958-9_18

    Chapter  Google Scholar 

  25. Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. 100(9), 690–691 (1979)

    Article  Google Scholar 

  26. Liu, Y., Chen, W., Liu, Y.A., Sun, J.: Model checking linearizability via refinement. In: Cavalcanti, A., Dams, D.R. (eds.) FM 2009. LNCS, vol. 5850, pp. 321–337. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-05089-3_21

    Chapter  Google Scholar 

  27. Long, Z., Zhang, Y.: Checking linearizability with fine-grained traces. In: Proceedings of the 31st Annual ACM Symposium on Applied Computing, pp. 1394–1400. ACM (2016)

    Google Scholar 

  28. Lowe, G.: Testing for linearizability. Concurrency and Computation: Practice and Experience 29(4), e3928 (2017)

    Article  Google Scholar 

  29. Nanevski, A., Banerjee, A., Delbianco, G.A., Fábregas, I.: Specifying concurrent programs in separation logic: Morphisms and simulations. arXiv preprint arXiv:1904.07136 (2019)

  30. OpenCL: The opencl specification (2010). https://www.khronos.org/opencl/

  31. Ou, P., Demsky, B.: Checking concurrent data structures under the c/c++ 11 memory model. In: Proceedings of the 22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP 2017), vol. 52, pp. 45–59. ACM (2017)

    Google Scholar 

  32. Owens, S., Sarkar, S., Sewell, P.: A better x86 memory model: x86-TSO. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 391–407. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03359-9_27

    Chapter  Google Scholar 

  33. Ozkan, B.K., Majumdar, R., Niksic, F.: Checking linearizability using hitting families. In: Proceedings of the 24th Symposium on Principles and Practice of Parallel Programming (PPoPP 2019), pp. 366–377. ACM (2019)

    Google Scholar 

  34. Papadimitriou, C.H.: Serializability of concurrent database updates. J. Assoc. Comput. Machinery 26(4), 631–653 (1979)

    Article  MathSciNet  Google Scholar 

  35. Sergey, I., Nanevski, A., Banerjee, A., Delbianco, G.A.: Hoare-style specifications as correctness conditions for non-linearizable concurrent objects. In: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016), vol. 51(10), pp. 92–110 (2016)

    Google Scholar 

  36. Shacham, O., Bronson, N., Aiken, A., Sagiv, M., Vechev, M., Yahav, E.: Testing atomicity of composed concurrent operations. In: Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA 2011), vol. 46, pp. 51–64. ACM (2011)

    Google Scholar 

  37. Shacham, O., et al.: Verifying atomicity via data independence. In: Proceedings of the 2014 International Symposium on Software Testing and Analysis, pp. 26–36. ACM (2014)

    Google Scholar 

  38. Siegel, S.F., et al.: Civl: the concurrency intermediate verification language. In: SC 2015: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1–12. IEEE (2015)

    Google Scholar 

  39. Vafeiadis, V.: Automatically proving linearizability. In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 450–464. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14295-6_40

    Chapter  Google Scholar 

  40. Vechev, M., Yahav, E., Yorsh, G.: Experience with model checking linearizability. In: Păsăreanu, C.S. (ed.) SPIN 2009. LNCS, vol. 5578, pp. 261–278. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02652-2_21

    Chapter  Google Scholar 

  41. Wang, L., Stoller, S.D.: Runtime analysis of atomicity for multithreaded programs. IEEE Trans. Software Eng. 32(2), 93–110 (2006)

    Article  Google Scholar 

  42. Wing, J.M., Gong, C.: Testing and verifying concurrent objects. J. Parallel Distributed Comput. 17(1–2), 164–182 (1993)

    Article  MathSciNet  Google Scholar 

  43. Wu, S., Yang, C., Chan, W.: ASR: abstraction subspace reduction for exposing atomicity violation bugs in multithreaded programs. In: 2015 IEEE International Conference on Software Quality, Reliability and Security, pp. 272–281. IEEE (2015)

    Google Scholar 

  44. Zhang, L., Chattopadhyay, A., Wang, C.: Round-up: runtime verification of quasi linearizability for concurrent data structures. IEEE Trans. Softw. Eng. 41(12), 1202–1216 (2015)

    Article  Google Scholar 

  45. Zomer, O., Golan-Gueta, G., Ramalingam, G., Sagiv, M.: Checking linearizability of encapsulated extended operations. In: Shao, Z. (ed.) ESOP 2014. LNCS, vol. 8410, pp. 311–330. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54833-8_17

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christina Peterson .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Peterson, C., Cook, V., Dechev, D. (2021). Concurrent Correctness in Vector Space. In: Henglein, F., Shoham, S., Vizel, Y. (eds) Verification, Model Checking, and Abstract Interpretation. VMCAI 2021. Lecture Notes in Computer Science(), vol 12597. Springer, Cham. https://doi.org/10.1007/978-3-030-67067-2_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-67067-2_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-67066-5

  • Online ISBN: 978-3-030-67067-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics