Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

Competitive parallelism: getting your priorities right

Published: 30 July 2018 Publication History

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.

Supplementary Material

WEBM File (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.
[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.
[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.
[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.
[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.
[6]
Richard P. Brent. 1974. The parallel evaluation of general arithmetic expressions. J. ACM 21, 2 (1974), 201–206.
[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.
[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.
[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.
[10]
Dennis Cornhill and Lui Sha. 1987. Priority Inversion in Ada. Ada Letters VII, 7 (Nov. 1987), 30–32.
[11]
Rowan Davies. 1996. A Temporal-Logic Approach to Binding-Time Analysis. In LICS. 184–195.
[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.
[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.
[14]
C. J. Fidge. 1993. A Formal Definition of Priority in CSP. ACM Trans. Program. Lang. Syst. 15, 4 (Sept. 1993), 681–705.
[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.
[16]
Matteo Frigo, Charles E. Leiserson, and Keith H. Randall. 1998. The Implementation of the Cilk-5 Multithreaded Language. In PLDI. 212–223.
[17]
Robert H. Halstead. 1985. MULTILISP: a language for concurrent symbolic computation. ACM Transactions on Programming Languages and Systems 7 (1985), 501–538.
[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.
[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.
[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.
[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.
[22]
Butler W. Lampson and David D. Redell. 1980. Experience with Processes and Monitors in Mesa. Commun. ACM 23, 2 (1980), 105–117.
[23]
G. Levine. 1988. The Control of Priority Inversion in Ada. Ada Lett. VIII, 6 (Nov. 1988), 53–56.
[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.
[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.03703
[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.
[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.
[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.
[29]
Tom Murphy, VII. 2008. Modal Types for Mobile Code. Ph.D. Dissertation. Carnegie Mellon. Available as technical report CMU-CS-08-126.
[30]
Tom Murphy, VII, Karl Crary, and Robert Harper. 2007. Type-safe Distributed Programming with ML5. In Trustworthy Global Computing 2007.
[31]
Frank Pfenning and Rowan Davies. 2001. A Judgmental Reconstruction of Modal Logic. Mathematical Structures in Computer Science 11 (2001), 511–540.
[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.
[33]
John H. Reppy. 1999. Concurrent Programming in ML. Cambridge University Press, New York, NY, USA.
[34]
Mads Rosendahl. 1989. Automatic complexity analysis. In FPCA ’89: Functional Programming Languages and Computer Architecture. ACM, 144–156.
[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.
[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.
[37]
Daniel Spoonhower. 2009. Scheduling Deterministic Parallel Programs. Ph.D. Dissertation. Carnegie Mellon University, Pittsburgh, PA, USA.
[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.
[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.
[40]
J.D. Ullman. 1975. NP-complete scheduling problems. J. Comput. System Sci. 10, 3 (1975), 384 – 393.
[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.

Cited By

View all
  • (2024)Modeling and Analyzing Evaluation Cost of CUDA KernelsACM Transactions on Parallel Computing10.1145/363940311:1(1-53)Online publication date: 12-Jan-2024
  • (2023)Efficient Parallel Functional Programming with EffectsProceedings of the ACM on Programming Languages10.1145/35912847:PLDI(1558-1583)Online publication date: 6-Jun-2023
  • (2023)Responsive Parallelism with SynchronizationProceedings of the ACM on Programming Languages10.1145/35912497:PLDI(712-735)Online publication date: 6-Jun-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 2, Issue ICFP
September 2018
1133 pages
EISSN:2475-1421
DOI:10.1145/3243631
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution-NoDerivatives International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 July 2018
Published in PACMPL Volume 2, Issue ICFP

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Concurrency
  2. Cost Semantics
  3. Parallelism
  4. Priorities

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)92
  • Downloads (Last 6 weeks)19
Reflects downloads up to 25 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Modeling and Analyzing Evaluation Cost of CUDA KernelsACM Transactions on Parallel Computing10.1145/363940311:1(1-53)Online publication date: 12-Jan-2024
  • (2023)Efficient Parallel Functional Programming with EffectsProceedings of the ACM on Programming Languages10.1145/35912847:PLDI(1558-1583)Online publication date: 6-Jun-2023
  • (2023)Responsive Parallelism with SynchronizationProceedings of the ACM on Programming Languages10.1145/35912497:PLDI(712-735)Online publication date: 6-Jun-2023
  • (2023)An Efficient Scheduler for Task-Parallel Interactive ApplicationsProceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3558481.3591092(27-38)Online publication date: 17-Jun-2023
  • (2022)Entanglement detection with near-zero costProceedings of the ACM on Programming Languages10.1145/35476466:ICFP(679-710)Online publication date: 31-Aug-2022
  • (2022)Static prediction of parallel computation graphsProceedings of the ACM on Programming Languages10.1145/34987086:POPL(1-31)Online publication date: 12-Jan-2022
  • (2022)Send to me first: Priority in synchronous message-passingJournal of Functional Programming10.1017/S095679682200011932Online publication date: 22-Dec-2022
  • (2022)Fairness and communication-based semantics for session-typed languagesInformation and Computation10.1016/j.ic.2022.104892285:PBOnline publication date: 1-May-2022
  • (2021)Provably space-efficient parallel functional programmingProceedings of the ACM on Programming Languages10.1145/34342995:POPL(1-33)Online publication date: 4-Jan-2021
  • (2021)Real-time MLton: A Standard ML runtime for real-time functional programsJournal of Functional Programming10.1017/S095679682100017431Online publication date: 31-Aug-2021
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media