Advertisement

Tackling Real-Life Relaxed Concurrency with FSL++

  • Marko DokoEmail author
  • Viktor Vafeiadis
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10201)

Abstract

We extend fenced separation logic (FSL), a program logic for reasoning about C11 relaxed access and memory fences. Our extensions to FSL allow us to handle concurrent algorithms appearing in practice. New features added to FSL allow for reasoning about concurrent non-atomic reads, atomic updates, ownership transfer via release sequences, and ghost state. As a demonstration of power of the extended FSL, we verify correctness of the atomic reference counter (ARC), a standard library of the Rust programing language, whose implementation relies heavily on advanced features of the C11 memory model. Soundness of FSL and its extensions, as well as the correctness proof of ARC have been established in Coq.

Keywords

Sequential Consistency Access Permission Reference Counter Soundness Proof Weak Memory 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Notes

Acknowledgments

We would like to thank Soham Chakraborty, Rayna Dimitrova, Jeehoon Kang, Ori Lahav, Alex Summers, and the ESOP’17 reviewers for their feedback.

References

  1. 1.
    Atomic reference counter (ARC) documentation. https://doc.rust-lang.org/std/sync/struct.Arc.html
  2. 2.
    The Rust programming language. https://www.rust-lang.org/
  3. 3.
    Alglave, J.: Simulation and invariance for weak consistency. In: Rival, X. (ed.) SAS 2016. LNCS, vol. 9837, pp. 3–22. Springer, Heidelberg (2016). doi: 10.1007/978-3-662-53413-7_1 CrossRefGoogle Scholar
  4. 4.
    Alglave, J., Kroening, D., Nimal, V., Poetzl, D.: Don’t sit on the fence - a static analysis approach to automatic fence insertion. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 508–524. Springer, Heidelberg (2014). doi: 10.1007/978-3-319-08867-9_33 Google Scholar
  5. 5.
    Batty, M., Dodds, M., Gotsman, A.: Library abstraction for C/C++ concurrency. In: POPL 2013, pp. 235–248. ACM (2013)Google Scholar
  6. 6.
    Batty, M., Owens, S., Sarkar, S., Sewell, P., Weber, T.: Mathematizing C++ concurrency. In: POPL 2011, pp. 55–66. ACM (2011)Google Scholar
  7. 7.
    Boehm, H., Demsky, B.: Outlawing ghosts: avoiding out-of-thin-air results. In: Singer, J., Kulkarni, M., Harris, T. (eds.) MSPC 2014, pp. 7:1–7:6. ACM (2014)Google Scholar
  8. 8.
    Bornat, R., Calcagno, C., O’Hearn, P.W., Parkinson, M.J.: Permission accounting in separation logic. In: POPL 2005, pp. 259–270. ACM (2005)Google Scholar
  9. 9.
    Bouajjani, A., Meyer, R., Möhlmann, E.: Deciding robustness against total store ordering. In: Aceto, L., Henzinger, M., Sgall, J. (eds.) ICALP 2011. LNCS, vol. 6756, pp. 428–440. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22012-8_34 CrossRefGoogle Scholar
  10. 10.
    Boyland, J.: Checking interference with fractional permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55–72. Springer, Heidelberg (2003). doi: 10.1007/3-540-44898-5_4 CrossRefGoogle Scholar
  11. 11.
    Derevenetc, E., Meyer, R.: Robustness against power is PSpace-complete. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) ICALP 2014. LNCS, vol. 8573, pp. 158–170. Springer, Heidelberg (2014). doi: 10.1007/978-3-662-43951-7_14 Google Scholar
  12. 12.
    Dinsdale-Young, T., Birkedal, L., Gardner, P., Parkinson, M.J., Yang, H.: Views: compositional reasoning for concurrent programs. In: Giacobazzi, R., Cousot, R. (eds.) POPL 2013, pp. 287–300. ACM (2013)Google Scholar
  13. 13.
    Doko, M., Vafeiadis, V.: A program logic for C11 memory fences. In: Jobstmann, B., Leino, K.R.M. (eds.) VMCAI 2016. LNCS, vol. 9583, pp. 413–430. Springer, Heidelberg (2016). doi: 10.1007/978-3-662-49122-5_20 CrossRefGoogle Scholar
  14. 14.
    He, M., Vafeiadis, V., Qin, S., Ferreira, J.F.: Reasoning about fences and relaxed atomics. In: PDP 2016, pp. 520–527. IEEE Computer Society (2016)Google Scholar
  15. 15.
    ISO/IEC 14882:2011: Programming language C++ (2011)Google Scholar
  16. 16.
    ISO/IEC 9899: 2011: Programming language C (2011)Google Scholar
  17. 17.
    Jeffrey, A., Riely, J.: On thin air reads towards an event structures model of relaxed memory. In: LICS 2016, pp. 759–767. ACM (2016)Google Scholar
  18. 18.
    Jensen, J.B., Birkedal, L.: Fictional separation logic. In: Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 377–396. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28869-2_19 CrossRefGoogle Scholar
  19. 19.
    Kang, J., Hur, C.K., Lahav, O., Vafeiadis, V., Dreyer, D.: A promising semantics for relaxed-memory concurrency. In: POPL 2017, pp. 175–189. ACM (2017)Google Scholar
  20. 20.
    Lahav, O., Giannarakis, N., Vafeiadis, V.: Taming release-acquire consistency. In: Bodík, R., Majumdar, R. (eds.) POPL 2016, pp. 649–662. ACM (2016)Google Scholar
  21. 21.
    Lahav, O., Vafeiadis, V.: Owicki-Gries reasoning for weak memory models. In: Halldórsson, M.M., Iwama, K., Kobayashi, N., Speckmann, B. (eds.) ICALP 2015. LNCS, vol. 9135, pp. 311–323. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-47666-6_25 Google Scholar
  22. 22.
    Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. 28(9), 690–691 (1979)CrossRefzbMATHGoogle Scholar
  23. 23.
    Ley-Wild, R., Nanevski, A.: Subjective auxiliary state for coarse-grained concurrency. In: Giacobazzi, R., Cousot, R. (eds.) POPL 2013, pp. 561–574. ACM (2013)Google Scholar
  24. 24.
    Meshman, Y., Rinetzky, N., Yahav, E.: Pattern-based synthesis of synchronization for the C++ memory model. In: Kaivola, R., Wahl, T. (eds.) FMCAD 2015, pp. 120–127. IEEE (2015)Google Scholar
  25. 25.
    Norris, B., Demsky, B.: CDSChecker: Checking concurrent data structures written with C/C++ atomics. In: Hosking, A.L., Eugster, P.T., Lopes, C.V. (eds.) OOPSLA 2013, pp. 131–150. ACM (2013)Google Scholar
  26. 26.
    O’Hearn, P.W.: Resources, concurrency and local reasoning. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS, vol. 3170, pp. 49–67. Springer, Heidelberg (2004). doi: 10.1007/978-3-540-28644-8_4 CrossRefGoogle Scholar
  27. 27.
    O’Hearn, P.W., Yang, H., Reynolds, J.C.: Separation and information hiding. ACM Trans. Program. Lang. Syst. 31(3), 11 (2009)zbMATHGoogle Scholar
  28. 28.
    Pichon-Pharabod, J., Sewell, P.: A concurrency semantics for relaxed atomics that permits optimisation and avoids thin-air executions. In: Bodík, R., Majumdar, R. (eds.) POPL 2016, pp. 622–633. ACM (2016)Google Scholar
  29. 29.
    Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: LICS 2002, pp. 55–74. IEEE Computer Society (2002)Google Scholar
  30. 30.
    Ridge, T.: A rely-guarantee proof system for x86-TSO. In: Leavens, G.T., O’Hearn, P., Rajamani, S.K. (eds.) VSTTE 2010. LNCS, vol. 6217, pp. 55–70. Springer, Heidelberg (2010). doi: 10.1007/978-3-642-15057-9_4 CrossRefGoogle Scholar
  31. 31.
    Sarkar, S., Memarian, K., Owens, S., Batty, M., Sewell, P., Maranget, L., Alglave, J., Williams, D.: Synchronising C/C++ and power. In: PLDI 2012, pp. 311–322. ACM (2012)Google Scholar
  32. 32.
    Sieczkowski, F., Svendsen, K., Birkedal, L., Pichon-Pharabod, J.: A separation logic for fictional sequential consistency. In: Vitek, J. (ed.) ESOP 2015. LNCS, vol. 9032, pp. 736–761. Springer, Heidelberg (2015). doi: 10.1007/978-3-662-46669-8_30 CrossRefGoogle Scholar
  33. 33.
    Tassarotti, J., Dreyer, D., Vafeiadis, V.: Verifying read-copy-update in a logic for weak memory. In: Grove, D., Blackburn, S. (eds.) PLDI 2015, pp. 110–120. ACM (2015)Google Scholar
  34. 34.
    Turon, A., Vafeiadis, V., Dreyer, D.: GPS: navigating weak-memory with ghosts, protocols, and separation. In: Black, A.P., Millstein, T.D. (eds.) OOPSLA 2014, pp. 691–707. ACM (2014)Google Scholar
  35. 35.
    Vafeiadis, V., Narayan, C.: Relaxed separation logic: a program logic for C11 concurrency. In: Hosking, A.L., Eugster, P.T., Lopes, C.V. (eds.) OOPSLA 2013, pp. 867–884. ACM (2013)Google Scholar

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  1. 1.Max Planck Institute for Software Systems (MPI-SWS)KaiserslauternGermany

Personalised recommendations