skip to main content
research-article
Open Access
Artifacts Evaluated & Functional

Competitive parallelism: getting your priorities right

Published:30 July 2018Publication History
Skip Abstract Section

Abstract

Multi-threaded programs have traditionally fallen into one of two domains: cooperative and competitive. These two domains have traditionally remained mostly disjoint, with cooperative threading used for increasing throughput in compute-intensive applications such as scientific workloads and cooperative threading used for increasing responsiveness in interactive applications such as GUIs and games. As multicore hardware becomes increasingly mainstream, there is a need for bridging these two disjoint worlds, because many applications mix interaction and computation and would benefit from both cooperative and competitive threading.

In this paper, we present techniques for programming and reasoning about parallel interactive applications that can use both cooperative and competitive threading. Our techniques enable the programmer to write rich parallel interactive programs by creating and synchronizing with threads as needed, and by assigning threads user-defined and partially ordered priorities. To ensure important responsiveness properties, we present a modal type system analogous to S4 modal logic that precludes low-priority threads from delaying high-priority threads, thereby statically preventing a crucial set of priority-inversion bugs. We then present a cost model that allows reasoning about responsiveness and completion time of well-typed programs. The cost model extends the traditional work-span model for cooperative threading to account for competitive scheduling decisions needed to ensure responsiveness. Finally, we show that our proposed techniques are realistic by implementing them as an extension to the Standard ML language.

Skip Supplemental Material Section

Supplemental Material

a95-muller.webm

References

  1. Umut A. Acar, Arthur Charguéraud, and Mike Rainey. 2013. Scheduling Parallel Programs by Work Stealing with Private Deques. In PPoPP ’13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Arvind and K. P. Gostelow. 1978. The Id Report: An Asychronous Language and Computing Machine. Technical Report TR-114. Department of Information and Computer Science, University of California, Irvine.Google ScholarGoogle Scholar
  3. Guy Blelloch and John Greiner. 1995. Parallelism in sequential functional languages. In Proceedings of the 7th International Conference on Functional Programming Languages and Computer Architecture (FPCA ’95). ACM, 226–237. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Guy E. Blelloch and John Greiner. 1996. A provable time and space efficient implementation of NESL. In Proceedings of the 1st ACM SIGPLAN International Conference on Functional Programming. ACM, 213–225. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Guy E. Blelloch, Jonathan C. Hardwick, Jay Sipelstein, Marco Zagha, and Siddhartha Chatterjee. 1994. Implementation of a Portable Nested Data-Parallel Language. J. Parallel Distrib. Comput. 21, 1 (1994), 4–14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Richard P. Brent. 1974. The parallel evaluation of general arithmetic expressions. J. ACM 21, 2 (1974), 201–206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Manuel M. T. Chakravarty, Roman Leshchinskiy, Simon L. Peyton Jones, Gabriele Keller, and Simon Marlow. 2007. Data parallel Haskell: a status report. In Proceedings of the POPL 2007 Workshop on Declarative Aspects of Multicore Programming, DAMP 2007, Nice, France, January 16, 2007. 10–18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Satish Chandra, Vijay Saraswat, Vivek Sarkar, and Rastislav Bodik. 2008. Type Inference for Locality Analysis of Distributed Data Structures. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP ’08). ACM, New York, NY, USA, 11–22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Philippe Charles, Christian Grothoff, Vijay Saraswat, Christopher Donawa, Allan Kielstra, Kemal Ebcioglu, Christoph von Praun, and Vivek Sarkar. 2005. X10: an object-oriented approach to non-uniform cluster computing. In Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA ’05). ACM, 519–538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dennis Cornhill and Lui Sha. 1987. Priority Inversion in Ada. Ada Letters VII, 7 (Nov. 1987), 30–32. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Rowan Davies. 1996. A Temporal-Logic Approach to Binding-Time Analysis. In LICS. 184–195. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Derek L. Eager, John Zahorjan, and Edward D. Lazowska. 1989. Speedup versus efficiency in parallel systems. IEEE Transactions on Computing 38, 3 (1989), 408–423. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Nicolas Feltman, Carlo Angiuli, Umut A. Acar, and Kayvon Fatahalian. 2016. Automatically Splitting a Two-Stage Lambda Calculus. In Proceedings of the 25 European Symposium on Programming, ESOP. 255–281.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. J. Fidge. 1993. A Formal Definition of Priority in CSP. ACM Trans. Program. Lang. Syst. 15, 4 (Sept. 1993), 681–705. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Matthew Fluet, Mike Rainey, John Reppy, and Adam Shaw. 2011. Implicitly threaded parallelism in Manticore. Journal of Functional Programming 20, 5-6 (2011), 1–40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. 1998. The Implementation of the Cilk-5 Multithreaded Language. In PLDI. 212–223. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Robert H. Halstead. 1985. MULTILISP: a language for concurrent symbolic computation. ACM Transactions on Programming Languages and Systems 7 (1985), 501–538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Carl Hauser, Christian Jacobi, Marvin Theimer, Brent Welch, and Mark Weiser. 1993. Using Threads in Interactive Systems: A Case Study. In Proceedings of the Fourteenth ACM Symposium on Operating Systems Principles (SOSP ’93). ACM, New York, NY, USA, 94–105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Suresh Jagannathan, Armand Navabi, KC Sivaramakrishnan, and Lukasz Ziarek. 2010. The Design Rationale for Multi-MLton. In ML ’10: Proceedings of the ACM SIGPLAN Workshop on ML. ACM.Google ScholarGoogle Scholar
  20. Limin Jia and David Walker. 2004. Modal Proofs as Distributed Programs. In 13th European Symposium on Programming, ESOP 2004, David Schmidt (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 219–233.Google ScholarGoogle ScholarCross RefCross Ref
  21. Gabriele Keller, Manuel M.T. Chakravarty, Roman Leshchinskiy, Simon Peyton Jones, and Ben Lippmeier. 2010. Regular, shape-polymorphic, parallel arrays in Haskell. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming (ICFP ’10). 261–272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Butler W. Lampson and David D. Redell. 1980. Experience with Processes and Monitors in Mesa. Commun. ACM 23, 2 (1980), 105–117. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G. Levine. 1988. The Control of Priority Inversion in Ada. Ada Lett. VIII, 6 (Nov. 1988), 53–56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Jonathan Moody. 2003. Modal Logic as a Basis for Distributed Computation. Technical Report CMU-CS-03-194. School of Computer Science, Carnegie Mellon University.Google ScholarGoogle Scholar
  25. Stefan Muller, Umut A. Acar, and Robert Harper. 2018. Competitive Parallelism: Getting Your Priorities Right. ArXiv e-prints (July 2018). arXiv: cs.PL/1807.03703Google ScholarGoogle Scholar
  26. Stefan K. Muller and Umut A. Acar. 2016. Latency-Hiding Work Stealing: Scheduling Interacting Parallel Computations with Work Stealing. In Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2016, Asilomar State Beach/Pacific Grove, CA, USA, July 11-13, 2016. 71–82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Stefan K. Muller, Umut A. Acar, and Robert Harper. 2017. Responsive Parallel Computation: Bridging Competitive and Cooperative Threading. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). ACM, New York, NY, USA, 677–692. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Tom Murphy, VII, Karl Crary, Robert Harper, and Frank Pfenning. 2004. A symmetric modal lambda calculus for distributed computing. In Proceedings of the 19th IEEE Symposium on Logic in Computer Science (LICS). IEEE Press, 286–295. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Tom Murphy, VII. 2008. Modal Types for Mobile Code. Ph.D. Dissertation. Carnegie Mellon. Available as technical report CMU-CS-08-126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tom Murphy, VII, Karl Crary, and Robert Harper. 2007. Type-safe Distributed Programming with ML5. In Trustworthy Global Computing 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Frank Pfenning and Rowan Davies. 2001. A Judgmental Reconstruction of Modal Logic. Mathematical Structures in Computer Science 11 (2001), 511–540. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Ram Raghunathan, Stefan K. Muller, Umut A. Acar, and Guy Blelloch. 2016. Hierarchical Memory Management for Parallel Programs. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming (ICFP 2016). ACM, New York, NY, USA, 392–406. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. John H. Reppy. 1999. Concurrent Programming in ML. Cambridge University Press, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Mads Rosendahl. 1989. Automatic complexity analysis. In FPCA ’89: Functional Programming Languages and Computer Architecture. ACM, 144–156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. David Sands. 1990. Complexity Analysis for a Lazy Higher-Order Language. In ESOP ’90: Proceedings of the 3rd European Symposium on Programming. Springer-Verlag, London, UK, 361–376. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. David Canfield Smith, Charles Irby, Ralph Kimball, Bill Verplank, and Eric Harslem. 1982. Designing the Star User Interface. BYTE Magazine 7, 4 (1982), 242–282.Google ScholarGoogle Scholar
  37. Daniel Spoonhower. 2009. Scheduling Deterministic Parallel Programs. Ph.D. Dissertation. Carnegie Mellon University, Pittsburgh, PA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Daniel Spoonhower, Guy E. Blelloch, Robert Harper, and Phillip B. Gibbons. 2008. Space Profiling for Parallel Functional Programs. In International Conference on Functional Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Daniel C. Swinehart, Polle T. Zellweger, Richard J. Beach, and Robert B. Hagmann. 1986. A Structural View of the Cedar Programming Environment. ACM Trans. Program. Lang. Syst. 8, 4 (Aug. 1986), 419–490. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. J.D. Ullman. 1975. NP-complete scheduling problems. J. Comput. System Sci. 10, 3 (1975), 384 – 393. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Kathy Yelick, Luigi Semenzato, Geoff Pike, Carleton Miyamoto, Ben Liblit, Arvind Krishnamurthy, Paul Hilfinger, Susan Graham, David Gay, Phil Colella, and Alex Aiken. 1998. Titanium: A high-performance Java dialect. In In ACM 1998 Workshop on Java for High-Performance Network Computing (New. ACM, Ed., ACM Press.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Competitive parallelism: getting your priorities right

          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

          Full Access

          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!