skip to main content
10.1145/1375581.1375599acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Sketching concurrent data structures

Published:07 June 2008Publication History

ABSTRACT

We describe PSketch, a program synthesizer that helps programmers implement concurrent data structures. The system is based on the concept of sketching, a form of synthesis that allows programmers to express their insight about an implementation as a partial program: a sketch. The synthesizer automatically completes the sketch to produce an implementation that matches a given correctness criteria.

PSketch is based on a new counterexample-guided inductive synthesis algorithm (CEGIS) that generalizes the original sketch synthesis algorithm from Solar-Lezama et.al. to cope efficiently with concurrent programs. The new algorithm produces a correct implementation by iteratively generating candidate implementations, running them through a verifier, and if they fail, learning from the counterexample traces to produce a better candidate; converging to a solution in a handful of iterations.

PSketch also extends Sketch with higher-level sketching constructs that allow the programmer to express her insight as a "soup" of ingredients from which complicated code fragments must be assembled. Such sketches can be viewed as syntactic descriptions of huge spaces of candidate programs (over 108 candidates for some sketches we resolved).

We have used the PSketch system to implement several classes of concurrent data structures, including lock-free queues and concurrent sets with fine-grained locking. We have also sketched some other concurrent objects including a sense-reversing barrier and a protocol for the dining philosophers problem; all these sketches resolved in under an hour.

References

  1. J. R. Allen, K. Kennedy, C. Porterfield, and J. Warren. Conversion of control dependence to data dependence. In POPL ?83: Proceedings of the 10th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 177--189, New York, NY, USA, 1983. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. D. Amit, N. Rinetzky, T. Reps, M. Sagiv, and E. Yahav. Comparison under abstraction for verifying linearizability. In CAV ?07: 19th International Conference on Computer Aided Verification, volume 4590, pages 477--490. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. Andre and S. Russell. Programmable reinforcement learning agents. Advances in Neural Information Processing Systems, 13, 2001. MIT Press.Google ScholarGoogle Scholar
  4. D. Angluin and C. H. Smith. Inductive inference: Theory and methods. ACM Comput. Surv., 15(3):237--269, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Y. Bar-David and G. Taubenfeld. Automatic discovery of mutual exclusion algorithms. In PODC ?03: Proceedings of the twentysecond annual symposium on Principles of distributed computing, pages 305--305, New York, NY, USA, 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Bilmes, K. Asanovic, C.-W. Chin, and J. Demmel. Optimizing matrix multiply using phipac: A portable, high-performance, ansi c coding methodology. In International Conference on Supercomputing, pages 340--347, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Burckhardt, R. Alur, and M. M. K. Martin. Checkfence: checking consistency of concurrent data types on relaxed memory models. In PLDI ?07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, volume 42, pages 12--21, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Fischer and J. Schumann. Autobayes: a system for generating data analysis programs from statistical models. Journal of Functional Programming, 13(3):483--508, May 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Heller, M. Herlihy, V. Luchangco, M. Moir, W. N. S. III, and N. Shavit. A lazy concurrent list-based set algorithm. In OPODIS ?05: 9th International Conference on Principles of Distributed Systems, volume 3974, pages 3--16. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Hensgen, R. Finkel, and U. Manber. Two algorithms for barrier synchronization. International Journal of Parallel Programming, 17(1):1--17, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Herlihy and N. Shavit. The art of multiprocessor programming. Morgan Kaufmann, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. P. Herlihy and J. M.Wing. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12(3):463--492, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. J. Holzmann. The model checker SPIN. Software Engineering, 23(5):279--295, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. Kowalski. Algorithm = logic + control. Commun. ACM, 22(7):424--436, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Transactions on Computers, 28(9):690--691, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Silberschatz and P. B. Galvin. Operating System Concepts. John Wiley & Sons, Inc., New York, NY, USA, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. R. Smith. KIDS: A semiautomatic program development system. IEEE Transactions on Software Engineering, 16(9):1024--1043, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI ?07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, volume 42, pages 167--178, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Solar-Lezama, R. Rabbah, R. Bodik, and K. Ebcioglu. Programming by sketching for bit-streaming programs. In PLDI ?05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pages 281--294, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In ASPLOS ?06, San Jose, CA, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2006), pages 404--415, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. V. Vafeiadis, M. Herlihy, T. Hoare, and M. Shapiro. Proving correctness of highly-concurrent linearisable objects. In PPoPP ?06: Proceedings of the eleventh ACM SIGPLAN symposium on Principles and practice of parallel programming, pages 129--136, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. T. Vechev, E. Yahav, and D. F. Bacon. Correctness-preserving derivation of concurrent garbage collection algorithms. In PLDI ?06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 341--353, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. T. Vechev, E. Yahav, D. F. Bacon, and N. Rinetzky. Cgcexplorer: a semi-automated search procedure for provably correct concurrent collectors. In PLDI ?07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 456--467, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Sketching concurrent data structures

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      PLDI '08: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2008
      396 pages
      ISBN:9781595938602
      DOI:10.1145/1375581
      • General Chair:
      • Rajiv Gupta,
      • Program Chair:
      • Saman Amarasinghe
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 43, Issue 6
        PLDI '08
        June 2008
        382 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1379022
        Issue’s Table of Contents

      Copyright © 2008 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 7 June 2008

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate406of2,067submissions,20%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!