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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
References
The racket reference (2019). https://docs.racket-lang.org/reference/channel.html
Using binder IPC (2020). https://source.android.com/devices/architecture/hidl/binder-ipc
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
Chaudhuri, A.: A concurrent ML library in concurrent Haskell. SIGPLAN Not. 44(9), 269–280 (2009). https://doi.org/10.1145/1631687.1596589
Demaine, E.: First class communication in MPI. In: Proceedings of the Second MPI Developers Conference, MPIDC 1996, p. 189. IEEE Computer Society, USA (1996)
Donnelly, K., Fluet, M.: Transactional events. J. Funct. Program. 18(5–6), 649–706 (2008). https://doi.org/10.1017/S0956796808006916
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
Flatt, M., Findler, R.B.: Kill-safe synchronization abstractions. SIGPLAN Not. 39(6), 47–58 (2004). https://doi.org/10.1145/996893.996849
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
Gansner, E.R., Reppy, J.H.: A Multi-Threaded Higher-Order User Interface Toolkit (1993)
Gerrand, A.: Share memory by communicating (2010). https://blog.golang.org/share-memory-by-communicating
Haller, P., Odersky, M.: Scala actors: unifying thread-based and event-based programming. Theor. Comput. Sci. 410, 202–220 (2009)
Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in Erlang, 2nd edn. Prentice-Hall (1996)
Klabnik, S., Nichols, C.: The rust programming language (2020). https://doc.rust-lang.org/book/ch16-02-message-passing.html
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
Milner, R., Tofte, M., Macqueen, D.: The Definition of Standard ML. MIT Press, Cambridge (1997)
Mueller, F.: A library implementation of posix threads under Unix. In: USENIX Winter (1993)
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
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
Reppy, J.H.: Concurrent Programming in ML, 1st edn. Cambridge University Press, New York (2007)
Russell, G.: Events in Haskell, and how to implement them. SIGPLAN Not. 36(10), 157–168 (2001). https://doi.org/10.1145/507669.507655
Shipman, A.L.: System Programming with Standard ML (2002)
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
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
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
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
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)