Abstract
We argue that the utility of time as a semantic property of software is not limited to the domain of real-time systems. This paper outlines four concurrent design patterns: alignment, precedence, simultaneity, and consistency, all of which are relevant to general-purpose software applications. We show that a semantics of logical time provides a natural framework for reasoning about concurrency, makes some difficult problems easy, and offers a quantified interpretation of the CAP theorem, enabling quantified evaluation of the tradeoff between consistency and availability.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Lingua Franca actually uses a richer model of time called “superdense time,” but this is irrelevant to the present discussion, so we simplify to just refer to timestamps.
- 2.
The federated infrastructure of Lingua Franca is currently rather preliminary, being built by Soroush Bateni and the two of us, but it is sufficiently developed for the examples described in this paper.
- 3.
The diagram synthesis infrastructure was created by Alexander Schulz-Rosengarten of the University of Kiel using the graphical layout tools from the KIELER Lightweight Diagrams framework [33] (see https://rtsys.informatik.uni-kiel.de/kieler).
- 4.
The name of this problem illustrates how cultural norms have changed. In 1971, there was little cultural stigma around smoking cigarettes, and it was relatively common for smokers to roll their own.
- 5.
See for example OpenCSF: https://w3.cs.jmu.edu/kirkpams/OpenCSF/Books/csf/html/CigSmokers.html, although, unfortunately, the solution given there still exhibits the possibility of a form of deadlock, where one thread repeatedly, unfairly acquires a semaphore in a busy wait.
References
Allen, J.: Effective Akka: Patterns and Best Practices. " O’Reilly Media, Inc." (2013)
Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent programming in Erlang. Prentice Hall, second edn. (1996)
Benveniste, A., Berry, G.: The synchronous approach to reactive and real-time systems. Proceedings of the IEEE 79(9), 1270–1282 (1991)
Brewer, E.: Towards robust distributed system. In: Symposium on Principles of Distributed Computing (PODC) (2000), keynote Talk
Brewer, E.: CAP twelve years later: How the “rules” have changed. Computer 45(2), 23–29 (2012). https://doi.org/10.1109/MC.2012.37
Burns, A., Wellings, A.: Real-Time Systems and Programming Languages: Ada 95, Real-Time Java and Real-Time POSIX. Addison-Wesley, 3d edn. (2001)
Cassandras, C.G.: Discrete Event Systems. Irwin, Modeling and Performance Analysis (1993)
Chandy, K.M., Misra, J.: Parallel Program Design: A Foundation. Addison Wesley (1988)
Corbett, J.C., Dean, J., Epstein, M., Fikes, A., Frost, C., Furman, J., Ghemawat, S., Gubarev, A., Heiser, C., Hochschild, P., Hsieh, W., Kanthak, S., Kogan, E., Li, H., Lloyd, A., Melnik, S., Mwaura, D., Nagle, D., Quinlan, S., Rao, R., Rolig, L., Saito, Y., Szymaniak, M., Taylor, C., Wang, R., Woodford, D.: Spanner: Google’s globally-distributed database. In: OSDI (2012). https://doi.org/10.1145/2491245
Dijkstra, E.W.: Cooperating sequential processes. In: The origin of concurrent programming, pp. 65–138. Springer (1968)
Downey, A.B.: The Little Book of Semaphores, vol. Version 2.2.1. Green Tea Press, second edition edn. (2016), https://greenteapress.com/semaphores/LittleBookOfSemaphores.pdf
Eidson, J., Lee, E.A., Matic, S., Seshia, S.A., Zou, J.: Distributed real-time software for cyber-physical systems. Proceedings of the IEEE (special issue on CPS) 100(1), 45–59 (2012). https://doi.org/10.1109/JPROC.2011.2161237
Eugster, P.T., Felber, P.A., Gerraoui, R., Kermarrec, A.M.: The many faces of publish/subscribe. ACM Computing Surveys 35(2), 114–131 (2003). https://doi.org/10.1145/857076.857078
Galletly, J.: Occam-2. University College London Press, 2nd edn. (1996)
Hewitt, C., Bishop, P.B., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In: Proceedings of the 3rd International Joint Conference on Artificial Intelligence. Standford, CA, USA, August 20–23, 1973. pp. 235–245 (1973)
Hunkeler, U., Truong, H.L., Stanford-Clark, A.: MQTT-S–A publish/subscribe protocol for wireless sensor networks. In: 3rd International Conference on Communication Systems Software and Middleware and Workshops (COMSWARE’08). pp. 791–798. IEEE (2008)
Imam, S., Sarkar, V.: Savina - an actor benchmark suite enabling empirical evaluation of actor libraries. In: Workshop on Programming based on Actors, Agents, and Decentralized Control (AGERE) (2014).https://doi.org/10.1145/2687357.2687368
Jefferson, D.: Virtual time. ACM Trans. Programming Languages and Systems 7(3), 404–425 (1985)
Jerad, C., Lee, E.A.: Deterministic timing for the industrial internet of things. In: IEEE Int. Conf. on Industrial Internet (ICII). IEEE (Oct 21–23 2018)
Klingerman, E., Stoyenko, A.: Real-time Euclid: A language for reliable real-time systems. IEEE Tr. on Software Engineering 12(9), 941–949 (1986)
Kuhl, F., Weatherly, R., Dahmann, J.: Creating Computer Simulation Systems: an Introduction to the High Level Architecture. Prentice Hall PTR (1999)
Lamport, L.: Time, clocks, and the ordering of events in a distributed system. Communications of the ACM 21(7), 558–565 (1978). https://doi.org/10.1145/359545.359563
Lamport, L.: Using time instead of timeout for fault-tolerant distributed systems. ACM Transactions on Programming Languages and Systems 6(2), 254–280 (1984)
Liskov, B.H., Ladin, R.: Highly available distributed services and fault-tolerant distributed garbage collection. In: Symposium on Principles of distributed computing (PODC). pp. 29–39. ACM (November 1986). https://doi.org/10.1145/10590.10593
Lohstroh, M., Menard, C., Bateni, S., Lee, E.A.: Toward a Lingua Franca for deterministic concurrent systems. ACM Transactions on Embedded Computing Systems (TECS) 20(4), Article 36 (May 2021). https://doi.org/10.1145/3448128
Lohstroh, M., Menard, C., Schulz-Rosengarten, A., Weber, M., Castrillon, J., Lee, E.A.: A language for deterministic coordination across multiple timelines. In: Forum for Specification and Design Languages (FDL). IEEE (September 15–17 2020). https://doi.org/10.1109/FDL50818.2020.9232939
Martin, T.: Real-time programing language PEARL - concept and characteristics. In: Computer Software and Applications Conference (COMPSAC). pp. 301–306 (1978)
Menard, C., Goens, A., Lohstroh, M., Castrillon, J.: Determinism in Adaptive AUTOSAR. In: Proceedings of the 2020 Design, Automation and Test in Europe Conference (DATE) (March 2020). https://doi.org/10.23919/DATE48585.2020.9116430
Moritz, P., Nishihara, R., Wang, S., Tumanov, A., Liaw, R., Liang, E., Paul, W., Jordan, M.I., Stoica, I.: Ray: A distributed framework for emerging AI applications. CoRR abs/1712.05889 (2017)
Parnas, D.L.: On a solution to the cigarette smokers’ problem (without conditional statements). Communications of the ACM 18(3), 181–183 (1975). https://doi.org/10.1145/360680.360709
Patil, S.S.: Limitations and capabilities of Dijkstra’s semaphore primitives for coordination among processes. Report, Computation Structures Group, Project MAC, MIT (February (1971)
Quigley, M., Conley, K., Gerkey, B., Faust, J., Foote, T., Leibs, J., Wheeler, R., Ng, A.Y., et al.: ROS: an open-source robot operating system. In: ICRA workshop on open source software. vol. 3, p. 5. Kobe, Japan (2009)
Schneider, C., Spönemann, M., von Hanxleden, R.: Just model! - Putting automatic synthesis of node-link-diagrams into practice. In: Proceedings of the IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC ’13). pp. 75–82. San Jose, CA, USA (9 2013)
Wirth, N.: Toward a discipline of real-time programming. Commun. ACM 20(8), 577–583 (1977)
Wirth, N.: Report on the programming language Modula-2. In: Programming in Modula-2, pp. 139–165. Springer (1983)
Zeigler, B.P., Praehofer, H., Kim, T.G.: Theory of Modeling and Simulation. Academic Press, 2nd edn. (2000)
Zhao, Y., Lee, E.A., Liu, J.: A programming model for time-synchronized distributed real-time systems. In: Real-Time and Embedded Technology and Applications Symposium (RTAS). pp. 259–268. IEEE (2007). https://doi.org/10.1109/RTAS.2007.5
Acknowledgments
The authors would like to acknowledge and thank the following people for their contributions to the design and implementation of Lingua Franca: Soroush Bateni, Shaokai Lin, Christian Menard, Alexander Schulz-Rosengarten, and Matt Weber. The work in this paper was supported in part by the National Science Foundation (NSF) award #CNS-1836601 (Reconciling Safety with the Internet) and the iCyPhy (Industrial Cyber-Physical Systems) research center, supported by Denso, Siemens, and Toyota.
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
Lee, E.A., Lohstroh, M. (2021). Time for All Programs, Not Just Real-Time Programs. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. ISoLA 2021. Lecture Notes in Computer Science(), vol 13036. Springer, Cham. https://doi.org/10.1007/978-3-030-89159-6_15
Download citation
DOI: https://doi.org/10.1007/978-3-030-89159-6_15
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-89158-9
Online ISBN: 978-3-030-89159-6
eBook Packages: Computer ScienceComputer Science (R0)