ABSTRACT
Multithreaded programs are hard to get right. A key reason is that the contract between developers and runtimes grants exponentially many schedules to the runtimes. We present Parrot, a simple, practical runtime with a new contract to developers. By default, it orders thread synchronizations in the well-defined round-robin order, vastly reducing schedules to provide determinism (more precisely, deterministic synchronizations) and stability (i.e., robustness against input or code perturbations, a more useful property than determinism). When default schedules are slow, it allows developers to write intuitive performance hints in their code to switch or add schedules for speed. We believe this "meet in the middle" contract eases writing correct, efficient programs.
We further present an ecosystem formed by integrating Parrot with a model checker called dbug. This ecosystem is more effective than either system alone: dbug checks the schedules that matter to Parrot, and Parrot greatly increases the coverage of dbug.
Results on a diverse set of 108 programs, roughly 10× more than any prior evaluation, show that Parrot is easy to use (averaging 1.2 lines of hints per program); achieves low overhead (6.9% for 55 real-world programs and 12.7% for all 108 programs), 10× better than two prior systems; scales well to the maximum allowed cores on a 24-core server and to different scales/types of workloads; and increases Dbug's coverage by 106--1019734 for 56 programs. Parrot's source code, entire benchmark suite, and raw results are available at github.com/columbia/smt-mc.
Supplemental Material
- Complete source code, benchmark suite, and raw results of the PARROT thread runtime. https://github.com/columbia/smt-mc.Google Scholar
- The Princeton application repository for shared-memory computers (PARSEC). http://parsec.cs.princeton.edu/.Google Scholar
- Parallel BZIP2 (PBZIP2). http://compression.ca/pbzip2/.Google Scholar
- Aget. http://www.enderunix.org/aget/.Google Scholar
- J. Albrecht, C. Tuttle, A. C. Snoeren, and A. Vahdat. Loose synchronization for large-scale networked systems. In Proceedings of the USENIX Annual Technical Conference (USENIX '06), pages 28--28, 2006. Google ScholarDigital Library
- A. Aviram, S.-C. Weng, S. Hu, and B. Ford. Efficient system-enforced deterministic parallelism. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarDigital Library
- A. F. Aviram. Deterministic OpenMP. PhD thesis, Yale University, 2012. Google ScholarDigital Library
- Bench3n. http://libdb.wordpress.com/3n1/.Google Scholar
- T. Bergan, O. Anderson, J. Devietti, L. Ceze, and D. Grossman. CoreDet: a compiler and runtime system for deterministic multithreaded execution. In Fifteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '10), pages 53--64, Mar. 2010. Google ScholarDigital Library
- T. Bergan, N. Hunt, L. Ceze, and S. D. Gribble. Deterministic process groups in dOS. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarDigital Library
- T. Bergan, L. Ceze, and D. Grossman. Input-covering schedules for multithreaded programs. In Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '13), Oct. 2013.Google ScholarDigital Library
- E. Berger, T. Yang, T. Liu, D. Krishnan, and A. Novark. Grace: safe and efficient concurrent programming. In Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '09), pages 81--96, Oct. 2009.Google ScholarDigital Library
- Berkeley DB. http://www.sleepycat.com.Google Scholar
- O. A. R. Board. OpenMP application program interface version 3.0, May 2008.Google Scholar
- R. L. Bocchino, Jr., V. S. Adve, D. Dig, S. V. Adve, S. Heumann, R. Komuravelli, J. Overbey, P. Simmons, H. Sung, and M. Vakilian. A type and effect system for deterministic parallel java. In Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '09), pages 97--116, Oct. 2009. Google ScholarDigital Library
- H. Cui, J. Wu, C.-C. Tsai, and J. Yang. Stable deterministic multithreading through schedule memoization. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarDigital Library
- H. Cui, J. Wu, J. Gallagher, H. Guo, and J. Yang. Efficient deterministic multithreading through schedule relaxation. In Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP '11), pages 337--351, Oct. 2011. Google ScholarDigital Library
- J. Devietti, B. Lucia, L. Ceze, and M. Oskin. DMP: deterministic shared memory multiprocessing. In Fourteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '09), pages 85--96, Mar. 2009. Google ScholarDigital Library
- A. C. Dusseau, R. H. Arpaci, and D. E. Culler. Effective distributed scheduling of parallel workloads. In Proceedings of the 1996 ACM SIGMETRICS Conference on Measurement and Modeling of Computer Systems (SIGMETRICS '96), pages 25--36, May 1996. Google ScholarDigital Library
- D. Engler and K. Ashcraft. RacerX: effective, static detection of race conditions and deadlocks. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP '03), pages 237--252, Oct. 2003. Google ScholarDigital Library
- C. Flanagan and P. Godefroid. Dynamic partial-order reduction for model checking software. In Proceedings of the 32nd Annual Symposium on Principles of Programming Languages (POPL '05), pages 110--121, Jan. 2005. Google ScholarDigital Library
- P. Godefroid. Model checking for programming languages using verisoft. In Proceedings of the 24th Annual Symposium on Principles of Programming Languages (POPL '97), pages 174--186, Jan. 1997. Google ScholarDigital Library
- H. Guo, M. Wu, L. Zhou, G. Hu, J. Yang, and L. Zhang. Practical software model checking via dynamic interface reduction. In Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP '11), pages 265--278, Oct. 2011. Google ScholarDigital Library
- M. D. Hill and M. Xu. Racey: A stress test for deterministic execution. http://www.cs.wisc.edu/~markhill/racey.html.Google Scholar
- N. Hunt, T. Bergan, L. Ceze, and S. Gribble. DDOS: Taming nondeterminism in distributed systems. In Eighteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '13), pages 499--508, 2013. Google ScholarDigital Library
- ImageMagick. http://www.imagemagick.org/script/index.php.Google Scholar
- M. Isard and A. Birrell. Automatic mutual exclusion. In Proceedings of the 11th USENIX workshop on Hot topics in operating systems (HOTOS '07), pages 3:1--3:6, 2007. Google ScholarDigital Library
- G. Jin, W. Zhang, D. Deng, B. Liblit, and S. Lu. Automated concurrency-bug fixing. In Proceedings of the Tenth Symposium on Operating Systems Design and Implementation (OSDI '12), pages 221--236, 2012. Google ScholarDigital Library
- H. Jula, D. Tralamazza, Z. Cristian, and C. George. Deadlock immunity: Enabling systems to defend against deadlocks. In Proceedings of the Eighth Symposium on Operating Systems Design and Implementation (OSDI '08), pages 295--308, Dec. 2008. Google ScholarDigital Library
- P. Kilby, J. K. Slaney, S. Thiébaux, and T. Walsh. Estimating search tree size. In Proceedings of the 21st national conference on Artificial intelligence (AAAI '06), pages 1014--1019, 2006. Google ScholarDigital Library
- C. Killian, J. W. Anderson, R. Jhala, and A. Vahdat. Life, death, and the critical transition: Finding liveness bugs in systems code. In Proceedings of the Fourth Symposium on Networked Systems Design and Implementation (NSDI '07), pages 243--256, Apr. 2007. Google ScholarDigital Library
- D. E. Knuth. Estimating the Efficiency of Back-track Programs. Mathematics of Computation, 29 (129):121--136, 1975.Google ScholarCross Ref
- N. G. Leveson and C. S. Turner. An investigation of the Therac-25 accidents. Computer, 26(7):18--41, 1993. Google ScholarDigital Library
- T. Liu, C. Curtsinger, and E. D. Berger. DTHREADS: efficient deterministic multithreading. In Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP '11), pages 327--336, Oct. 2011. Google ScholarDigital Library
- S. Lu, J. Tucek, F. Qin, and Y. Zhou. AVIO: detecting atomicity violations via access interleaving invariants. In Twelfth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '06), pages 37--48, Oct. 2006. Google ScholarDigital Library
- S. Lu, S. Park, C. Hu, X. Ma, W. Jiang, Z. Li, R. A. Popa, and Y. Zhou. Muvi: automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In Proceedings of the 21st ACM Symposium on Operating Systems Principles (SOSP '07), pages 103--116, 2007. Google ScholarDigital Library
- S. Lu, S. Park, E. Seo, and Y. Zhou. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In Thirteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '08), pages 329--339, Mar. 2008. Google ScholarDigital Library
- Mongoose. https://code.google.com/p/mongoose/.Google Scholar
- MPlayer. http://www.mplayerhq.hu/design7/news.html.Google Scholar
- M. Musuvathi, D. Y. Park, A. Chou, D. R. Engler, and D. L. Dill. CMC: A pragmatic approach to model checking real code. In Proceedings of the Fifth Symposium on Operating Systems Design and Implementation (OSDI '02), pages 75--88, Dec. 2002. Google ScholarDigital Library
- M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and reproducing heisenbugs in concurrent programs. In Proceedings of the Eighth Symposium on Operating Systems Design and Implementation (OSDI '08), pages 267--280, Dec. 2008. Google ScholarDigital Library
- NASA Parallel Benchmarks. http://www.nas.nasa.gov/publications/npb.html.Google Scholar
- M. Olszewski, J. Ansel, and S. Amarasinghe. Kendo: efficient deterministic multithreading in software. In Fourteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '09), pages 97--108, Mar. 2009. Google ScholarDigital Library
- M. Olszewski, J. Ansel, and S. Amarasinghe. Scaling deterministic multithreading. In The 2nd Workshop on Determinism and Correctness in Parallel Programming (WODET '11), Mar. 2011.Google Scholar
- OpenLDAP. http://www.openldap.org/.Google Scholar
- J. K. Ousterhout. Scheduling Techniques for Concurrent Systems. In Proceedings of Third International Conference on Distributed Computing Systems (ICDCS '82), pages 22--30, 1982.Google Scholar
- C.-S. Park and K. Sen. Randomized active atomicity violation detection in concurrent programs. In Proceedings of the 16th ACM SIGSOFT International Symposium on Foundations of Software Engineering (SIGSOFT '08/FSE-16), pages 135--145, Nov. 2008. Google ScholarDigital Library
- S. Park, S. Lu, and Y. Zhou. CTrigger: exposing atomicity violation bugs from their hiding places. In Fourteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '09), pages 25--36, Mar. 2009. Google ScholarDigital Library
- S. Park, Y. Zhou, W. Xiong, Z. Yin, R. Kaushik, K. H. Lee, and S. Lu. PRES: probabilistic replay with execution sketching on multiprocessors. In Proceedings of the 22nd ACM Symposium on Operating Systems Principles (SOSP '09), pages 177--192, Oct. 2009. Google ScholarDigital Library
- Perf. https://perf.wiki.kernel.org/index.php/Main_Page/.Google Scholar
- pfscan. http://ostatic.com/pfscan.Google Scholar
- K. Poulsen. Software bug contributed to blackout. http://www.securityfocus.com/news/8016, Feb. 2004.Google Scholar
- C. Ranger, R. Raghuraman, A. Penmetsa, G. Bradski, and C. Kozyrakis. Evaluating mapreduce for multi-core and multiprocessor systems. In Proceedings of the 2007 IEEE 13th International Symposium on High Performance Computer Architecture (HPCA '07), pages 13--24, 2007. Google ScholarDigital Library
- Redis. http://redis.io/.Google Scholar
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. E. Anderson. Eraser: A dynamic data race detector for multithreaded programming. ACM Transactions on Computer Systems, pages 391--411, Nov. 1997. Google ScholarDigital Library
- K. Sen. Race directed random testing of concurrent programs. In Proceedings of the ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation (PLDI '08), pages 11--21, June 2008. Google ScholarDigital Library
- J. Simsa, G. Gibson, and R. Bryant. dBug: Systematic Testing of Unmodified Distributed and Multi-Threaded Systems. In The 18th International SPIN Workshop on Model Checking of Software (SPIN'11), pages 188--193, 2011. Google ScholarDigital Library
- SPLASH-2x. http://parsec.cs.princeton.edu/parsec3-doc.htm.Google Scholar
- STL Parallel Mode. http://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode.html.Google Scholar
- VTune. http://software.intel.com/en-us/intel-vtune-amplifier-xe/.Google Scholar
- Y. Wang, T. Kelly, M. Kudlur, S. Lafortune, and S. Mahlke. Gadara: Dynamic deadlock avoidance for multithreaded programs. In Proceedings of the Eighth Symposium on Operating Systems Design and Implementation (OSDI '08), pages 281--294, Dec. 2008. Google ScholarDigital Library
- J. Wu, H. Cui, and J. Yang. Bypassing races in live applications with execution filters. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarDigital Library
- J. Wu, Y. Tang, G. Hu, H. Cui, and J. Yang. Sound and precise analysis of parallel programs through schedule specialization. In Proceedings of the ACM SIGPLAN 2012 Conference on Programming Language Design and Implementation (PLDI '12), pages 205--216, June 2012. Google ScholarDigital Library
- W. Xiong, S. Park, J. Zhang, Y. Zhou, and Z. Ma. Ad hoc synchronization considered harmful. In Proceedings of the Ninth Symposium on Operating Systems Design and Implementation (OSDI '10), Oct. 2010. Google ScholarDigital Library
- J. Yang, P. Twohey, D. Engler, and M. Musuvathi. Using model checking to find serious file system errors. In Proceedings of the Sixth Symposium on Operating Systems Design and Implementation (OSDI '04), pages 273--288, Dec. 2004. Google ScholarDigital Library
- J. Yang, C. Sar, and D. Engler. Explode: a lightweight, general system for finding serious storage system errors. In Proceedings of the Seventh Symposium on Operating Systems Design and Implementation (OSDI '06), pages 131--146, Nov. 2006. Google ScholarDigital Library
- J. Yang, T. Chen, M. Wu, Z. Xu, X. Liu, H. Lin, M. Yang, F. Long, L. Zhang, and L. Zhou. MODIST: Transparent model checking of unmodified distributed systems. In Proceedings of the Sixth Symposium on Networked Systems Design and Implementation (NSDI '09), pages 213--228, Apr. 2009. Google ScholarDigital Library
- J. Yang, A. Cui, S. Stolfo, and S. Sethumadhavan. Concurrency attacks. In the Fourth USENIX Workshop on Hot Topics in Parallelism (HOTPAR '12), June 2012. Google ScholarDigital Library
- J. Yang, H. Cui, and J. Wu. Determinism is over-rated: What really makes multithreaded programs hard to get right and what can be done about it? In the Fifth USENIX Workshop on Hot Topics in Parallelism (HOTPAR '13), June 2013.Google Scholar
- J. Yang, H. Cui, J. Wu, Y. Tang, and G. Hu. Determinism is not enough: Making parallel programs reliable with stable multithreading. Communications of the ACM, 2014.Google Scholar
- Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: efficient detection of data race conditions via adaptive tracking. In Proceedings of the 20th ACM Symposium on Operating Systems Principles (SOSP '05), pages 221--234, Oct. 2005. Google ScholarDigital Library
- W. Zhang, C. Sun, and S. Lu. ConMem: detecting severe concurrency bugs through an effect-oriented approach. In Fifteenth International Conference on Architecture Support for Programming Languages and Operating Systems (ASPLOS '10), pages 179--192, Mar. 2010. Google ScholarDigital Library
Index Terms
- Parrot: a practical runtime for deterministic, stable, and reliable threads
Recommendations
Efficient deterministic multithreading through schedule relaxation
SOSP '11: Proceedings of the Twenty-Third ACM Symposium on Operating Systems PrinciplesDeterministic multithreading (DMT) eliminates many pernicious software problems caused by nondeterminism. It works by constraining a program to repeat the same thread interleavings, or schedules, when given same input. Despite much recent research, it ...
Making lock-free data structures verifiable with artificial transactions
PLOS '15: Proceedings of the 8th Workshop on Programming Languages and Operating SystemsAmong all classes of parallel programming abstractions, lock-free data structures are considered one of the most scalable and efficient thanks to their fine-grained style of synchronization. However, they are also challenging for developers and tools to ...
Making Lock-free Data Structures Verifiable with Artificial Transactions
Special TopicsAmong all classes of parallel programming abstractions, lock-free data structures are considered one of the most scalable and efficient thanks to their fine-grained style of synchronization. However, they are also challenging for developers and tools to ...
Comments