Practical Permissions for Race-Free Parallelism

  • Edwin Westbrook
  • Jisheng Zhao
  • Zoran Budimlić
  • Vivek Sarkar
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7313)

Abstract

Type systems that prevent data races are a powerful tool for parallel programming, eliminating whole classes of bugs that are both hard to find and hard to fix. Unfortunately, it is difficult to apply previous such type systems to “real” programs, as each of them are designed around a specific synchronization primitive or parallel pattern, such as locks or disjoint heaps; real programs often have to combine multiple synchronization primitives and parallel patterns. In this work, we present a new permissions-based type system, which we demonstrate is practical by showing that it supports multiple patterns (e.g., task parallelism, object isolation, array-based parallelism), and by applying it to a suite of non-trivial parallel programs. Our system also has a number of theoretical advances over previous work on permissions-based type systems, including aliased write permissions and a simpler way to store permissions in objects than previous approaches.

Keywords

Operational Semantic Data Race Separation Logic Exclusive Permission Child Task 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abadi, M., Flanagan, C., Freund, S.N.: Types for safe locking: Static race detection for java. ACM Trans. Program. Lang. Syst. 28, 207–255 (2006)CrossRefGoogle Scholar
  2. 2.
    Bacon, D.F., Strom, R.E., Tarafdar, A.: Guava: a dialect of java without data races. In: OOPSLA (2000)Google Scholar
  3. 3.
    Bailey, D.H., et al.: The NAS parallel benchmarks. Intl. Journal of Supercomputer Applications 5(3) (1994)Google Scholar
  4. 4.
    Beckman, N.E., Bierhoff, K., Aldrich, J.: Verifying correct usage of atomic blocks and typestate. In: OOPSLA 2008 (2008)Google Scholar
  5. 5.
    Bierhoff, K., Aldrich, J.: Modular typestate checking of aliased objects. In: OOPSLA 2007 (2007)Google Scholar
  6. 6.
    Bocchino, R.L., et al.: A type and effect system for deterministic parallel java. In: OOPSLA 2009 (2009)Google Scholar
  7. 7.
    Bocchino, R.L., et al.: Safe nondeterminism in a deterministic-by-default parallel language. In: POPL 2011 (2011)Google Scholar
  8. 8.
    Boehm, H.-J., Adve, S.V.: Foundations of the c++ concurrency memory model. In: PLDI (2008)Google Scholar
  9. 9.
    Bornat, R., Calcagno, C., O’Hearn, P., Parkinson, M.: Permission accounting in separation logic. In: POPL (2005)Google Scholar
  10. 10.
    Bornat, R., Calcagno, C., Yang, H.: Variables as resource in separation logic. Electron. Notes Theor. Comput. Sci. 155, 247–276 (2006)CrossRefGoogle Scholar
  11. 11.
    Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: preventing data races and deadlocks. In: OOPSLA 2002 (2002)Google Scholar
  12. 12.
    Boyland, J.: Checking Interference with Fractional Permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55–72. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  13. 13.
    Boyland, J.: Semantics of fractional permissions with nesting. ACM Trans. Program. Lang. Syst. 32 (2010)Google Scholar
  14. 14.
    Cavé, V., Zhao, J., Shirako, J., Sarkar, V.: Habanero-java: the new adventures of old X10. In: Proceedings of the 9th International Conference on the Principles and Practice of Programming in Java, PPPJ (2011)Google Scholar
  15. 15.
    Clarke, D.G., Potter, J.M., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA (1998)Google Scholar
  16. 16.
    Dodds, M., Jagannathan, S., Parkinson, M.J.: Modular reasoning for deterministic parallelism. In: POPL 2011 (2011)Google Scholar
  17. 17.
    Duran, A., et al.: Barcelona openmp tasks suite: A set of benchmarks targeting the exploitation of task parallelism in openmp. In: ICPP (2009)Google Scholar
  18. 18.
    Fahndrich, M., DeLine, R.: Adoption and focus: practical linear types for imperative programming. In: PLDI (2002)Google Scholar
  19. 19.
    Flanagan, C., Freund, S.N.: Type-based race detection for java. In: PLDI (2000)Google Scholar
  20. 20.
    Haller, P., Odersky, M.: Capabilities for Uniqueness and Borrowing. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 354–378. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  21. 21.
    Heule, S., et al.: Fractional permissions without the fractions. In: Proceedings of the 13th Workshop on Formal Techniues for Java-Like Programs, FTfJP (2011)Google Scholar
  22. 22.
    Joyner, M.: Array Optimizations for High Productivity Programming Languages. PhD thesis, Rice University (2008)Google Scholar
  23. 23.
    Manson, J., Pugh, W., Adve, S.V.: The java memory model. In: POPL 2005 (2005)Google Scholar
  24. 24.
    Marino, D., et al.: DRFx: a simple and efficient memory model for concurrent programming languages. In: Proceedings of PLDI 2010 (2010)Google Scholar
  25. 25.
    Naik, M., Aiken, A., Whaley, J.: Effective static race detection for java. In: PLDI (2006)Google Scholar
  26. 26.
    Nanevski, A., Morrisett, G., Birkedal, L.: Hoare type theory, polymorphism and separation. J. Funct. Program. 18, 865–911 (2008)MathSciNetMATHCrossRefGoogle Scholar
  27. 27.
    Shirako, J., Kasahara, H., Sarkar, V.: Language Extensions in Support of Compiler Parallelization. In: Adve, V., Garzarán, M.J., Petersen, P. (eds.) LCPC 2007. LNCS, vol. 5234, pp. 78–94. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  28. 28.
    Siek, J.G., Taha, W.: Gradual typing for functional languages. In: Scheme and Functional Programming Workshop (2006)Google Scholar
  29. 29.
    Singh, A., et al.: Efficient processor support for DRFx, a memory model with exceptions. In: Proceedings of ASPLOS 2011 (2011)Google Scholar
  30. 30.
    Smith, L.A., Bull, J.M., Obdrzálek, J.: A parallel java grande benchmark suite. In: Proceedings of the 2001 ACM/IEEE Conference on Supercomputing (2001)Google Scholar
  31. 31.
    Vallée-Rai, R., Hendren, L., Sundaresan, V., Lam, P., Gagnon, E., Co, P.: Soot - a java optimization framework. In: Proceedings of CASCON 1999 (1999)Google Scholar
  32. 32.
    Vaziri, M., Tip, F., Dolby, J.: Associating synchronization constraints with data in an object-oriented language. In: POPL (2006)Google Scholar
  33. 33.
    Vaziri, M., Tip, F., Dolby, J., Hammer, C., Vitek, J.: A Type System for Data-Centric Synchronization. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 304–328. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  34. 34.
    Westbrook, E., Zhao, J., Budimlić, Z., Sarkar, V.: Permission regions for race-free parallelism. In: RV (2011)Google Scholar
  35. 35.
    Wolff, R., Garcia, R., Tanter, É., Aldrich, J.: Gradual Typestate. In: Mezini, M. (ed.) ECOOP 2011. LNCS, vol. 6813, pp. 459–483. Springer, Heidelberg (2011)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Edwin Westbrook
    • 1
  • Jisheng Zhao
    • 1
  • Zoran Budimlić
    • 1
  • Vivek Sarkar
    • 1
  1. 1.Rice UniversityHoustonUSA

Personalised recommendations