Skip to main content

Synchronous Message-Passing with Priority

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2021)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12548))

Included in the following conference series:

Abstract

In this paper we introduce a tiered-priority mechanism for a synchronous message-passing language with support for selective communication and first-class communication protocols. Crucially our mechanism allows higher priority threads to communicate with lower priority threads, providing the ability to express programs that would be rejected by classic priority mechanisms that disallow any (potentially) blocking interactions between threads of differing priorities. We provide a prototype implementation of our tiered-priority mechanism capable of expressing Concurrent ML and built in the MLton SML compiler and runtime. We evaluate the viability of our implementation by implementing a safe and predictable shutdown mechanisms in the Swerve webserver and eXene windowing toolkit. Our experiments show that priority can be easily added to existing CML programs without degrading performance. Our system exhibits negligible overheads on more modest workloads.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Available at: https://gist.github.com/Cheng-EnC/ea317edb62f01f55b85a9406f6093217.

References

  1. The racket reference (2019). https://docs.racket-lang.org/reference/channel.html

  2. Using binder IPC (2020). https://source.android.com/devices/architecture/hidl/binder-ipc

  3. Buttazzo, G.: Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications. Springer, New York (2011). https://doi.org/10.1007/978-1-4614-0676-1

    Book  MATH  Google Scholar 

  4. Chaudhuri, A.: A concurrent ML library in concurrent Haskell. SIGPLAN Not. 44(9), 269–280 (2009). https://doi.org/10.1145/1631687.1596589

    Article  MATH  Google Scholar 

  5. Demaine, E.: First class communication in MPI. In: Proceedings of the Second MPI Developers Conference, MPIDC 1996, p. 189. IEEE Computer Society, USA (1996)

    Google Scholar 

  6. Donnelly, K., Fluet, M.: Transactional events. J. Funct. Program. 18(5–6), 649–706 (2008). https://doi.org/10.1017/S0956796808006916

    Article  MATH  Google Scholar 

  7. Effinger-Dean, L., Kehrt, M., Grossman, D.: Transactional events for ML. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008, pp. 103–114. Association for Computing Machinery, New York (2008). https://doi.org/10.1145/1411204.1411222

  8. Flatt, M., Findler, R.B.: Kill-safe synchronization abstractions. SIGPLAN Not. 39(6), 47–58 (2004). https://doi.org/10.1145/996893.996849

    Article  Google Scholar 

  9. Fluet, M., Rainey, M., Reppy, J., Shaw, A.: Implicitly threaded parallelism in manticore. J. Funct. Program. 20(5–6), 537–576 (2010). https://doi.org/10.1017/S0956796810000201

    Article  MATH  Google Scholar 

  10. Gansner, E.R., Reppy, J.H.: A Multi-Threaded Higher-Order User Interface Toolkit (1993)

    Google Scholar 

  11. Gerrand, A.: Share memory by communicating (2010). https://blog.golang.org/share-memory-by-communicating

  12. Haller, P., Odersky, M.: Scala actors: unifying thread-based and event-based programming. Theor. Comput. Sci. 410, 202–220 (2009)

    Article  MathSciNet  Google Scholar 

  13. Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in Erlang, 2nd edn. Prentice-Hall (1996)

    Google Scholar 

  14. Klabnik, S., Nichols, C.: The rust programming language (2020). https://doc.rust-lang.org/book/ch16-02-message-passing.html

  15. Lampson, B.W., Redell, D.D.: Experience with processes and monitors in Mesa. Commun. ACM 23(2), 105–117 (1980). https://doi.org/10.1145/358818.358824

    Article  Google Scholar 

  16. Milner, R., Tofte, M., Macqueen, D.: The Definition of Standard ML. MIT Press, Cambridge (1997)

    Book  Google Scholar 

  17. Mueller, F.: A library implementation of posix threads under Unix. In: USENIX Winter (1993)

    Google Scholar 

  18. Muller, S.K., Acar, U.A., Harper, R.: Competitive parallelism: getting your priorities right. Proc. ACM Program. Lang. 2(ICFP), 1–30 (2018). https://doi.org/10.1145/3236790

  19. Reppy, J.H.: CML: a higher concurrent language. In: Proceedings of the ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation, PLDI 1991, pp. 293–305. ACM, New York (1991). https://doi.org/10.1145/113445.113470

  20. Reppy, J.H.: Concurrent Programming in ML, 1st edn. Cambridge University Press, New York (2007)

    MATH  Google Scholar 

  21. Russell, G.: Events in Haskell, and how to implement them. SIGPLAN Not. 36(10), 157–168 (2001). https://doi.org/10.1145/507669.507655

    Article  MATH  Google Scholar 

  22. Shipman, A.L.: System Programming with Standard ML (2002)

    Google Scholar 

  23. Swinehart, D.C., Zellweger, P.T., Hagmann, R.B.: The structure of cedar. In: Proceedings of the ACM SIGPLAN 85 Symposium on Language Issues in Programming Environments, SLIPE 1985, pp. 230–244. Association for Computing Machinery, New York (1985). https://doi.org/10.1145/800225.806844

  24. Ziarek, L., Sivaramakrishnan, K., Jagannathan, S.: Composable asynchronous events. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, pp. 628–639. Association for Computing Machinery, New York (2011). https://doi.org/10.1145/1993498.1993572

Download references

Acknowledgment

This work is supported in part by National Science Foundation grants: CRI:1823230 and SHF:1749539. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Cheng-En Chuang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Chuang, CE., Iraci, G., Ziarek, L. (2021). Synchronous Message-Passing with Priority. In: Morales, J.F., Orchard, D. (eds) Practical Aspects of Declarative Languages. PADL 2021. Lecture Notes in Computer Science(), vol 12548. Springer, Cham. https://doi.org/10.1007/978-3-030-67438-0_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-67438-0_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-67437-3

  • Online ISBN: 978-3-030-67438-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics