Beyond the Threaded Programming Model on Real-Time Operating Systems

Authors Erling Rennemo Jellum , Shaokai Lin , Peter Donovan , Efsane Soyer , Fuzail Shakir , Torleiv Bryne , Milica Orlandic , Marten Lohstroh , Edward A. Lee



PDF
Thumbnail PDF

File

OASIcs.NG-RES.2023.3.pdf
  • Filesize: 0.67 MB
  • 13 pages

Document Identifiers

Author Details

Erling Rennemo Jellum
  • NTNU, Trondheim, Norway
Shaokai Lin
  • University of California at Berkeley, CA, USA
Peter Donovan
  • University of California at Berkeley, CA, USA
Efsane Soyer
  • University of California at Berkeley, CA, USA
Fuzail Shakir
  • University of California at Berkeley, CA, USA
Torleiv Bryne
  • NTNU, Trondheim, Norway
Milica Orlandic
  • NTNU, Trondheim, Norway
Marten Lohstroh
  • University of California at Berkeley, CA, USA
Edward A. Lee
  • University of California at Berkeley, CA, USA

Acknowledgements

We want to thank Matthew Chorlian, Arthur Deng, Abanob Bostouros and Christian Menard for their work on porting the Savina benchmark to the Lingua Franca C target, as well as Hannes Klein and Felix Wittwer for their work on the original port of the Savina benchmark to the Lingua Franca C++ target. We would also like to acknowledge Soroush Bateni and Alexander Schulz-Rosengarten for their work on the Lingua Franca C runtime.

Cite AsGet BibTex

Erling Rennemo Jellum, Shaokai Lin, Peter Donovan, Efsane Soyer, Fuzail Shakir, Torleiv Bryne, Milica Orlandic, Marten Lohstroh, and Edward A. Lee. Beyond the Threaded Programming Model on Real-Time Operating Systems. In Fourth Workshop on Next Generation Real-Time Embedded Systems (NG-RES 2023). Open Access Series in Informatics (OASIcs), Volume 108, pp. 3:1-3:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2023)
https://doi.org/10.4230/OASIcs.NG-RES.2023.3

Abstract

The use of a real-time operating system (RTOS) raises the abstraction level for embedded systems design when compared to traditional bare-metal programming, resulting in simpler and more reusable application code. Modern RTOSes for resource-constrained platforms, like Zephyr and FreeRTOS, also offer threading support, but this kind of shared memory concurrency is a poor fit for expressing the reactive and interactive behaviors that are common in embedded systems. To address this, alternative concurrency models like the actor model or communicating sequential processes have been proposed. While those alternatives enable reactive design patterns, they fail to deliver determinism and do not address timing. This makes it difficult to verify that implemented behavior is as intended and impossible to specify timing constraints in a portable way. This makes it hard to create reusable library components out of common embedded design patterns, forcing developers to keep reinventing the wheel for each application and each platform. In this paper, we introduce the embedded target of Lingua Franca (LF) as a means to move beyond the threaded programming model provided by RTOSes and improve the state of the art in embedded programming. LF is based on the reactor model of computation, which is reactive, deterministic, and timed, providing a means to express concurrency and timing in a platform-independent way. We compare the performance of LF versus threaded C code - both running on Zephyr - in terms of response time, timing precision, throughput, and memory footprint.

Subject Classification

ACM Subject Classification
  • Computer systems organization → Embedded software
Keywords
  • Real time
  • concurrency
  • reactors
  • Lingua Franca
  • RTOS

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Gul Agha and Carl Hewitt. Actors: A Conceptual Foundation for Concurrent Object-Oriented Programming, pages 49-74. MIT Press, Cambridge, MA, USA, 1987. Google Scholar
  2. Thomas W. Barr and Scott Rixner. Medusa: Managing concurrency and communication in embedded systems. In Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference, USENIX ATC'14, pages 439-450, USA, 2014. USENIX Association. Google Scholar
  3. Fabrice Bellard. Qemu, a fast and portable dynamic translator. In USENIX annual technical conference, FREENIX Track, volume 41, pages 10-5555. Califor-nia, USA, 2005. Google Scholar
  4. The Linux Foundation. Zephyr RTOS. https://zephyrproject.org/ , 2022.
  5. Philipp Haller and Martin Odersky. Event-Based Programming Without Inversion of Control. In David E. Lightfoot and Clemens Szyperski, editors, Modular Programming Languages, Lecture Notes in Computer Science, pages 4-22. Springer, 2006. URL: https://doi.org/10.1007/11860990_2.
  6. C. A. R. Hoare. Communicating sequential processes. Commun. ACM, 21(8):666-677, August 1978. URL: https://doi.org/10.1145/359576.359585.
  7. Shams M. Imam and Vivek Sarkar. Savina - An actor benchmark suite: Enabling empirical evaluation of actor libraries. In Proceedings of the 4th International Workshop on Programming Based on Actors Agents & Decentralized Control, pages 67-80, 2014. Google Scholar
  8. iSotEE. Thread Metric Test Suite. https://github.com/iSotEE/thread_metric_test_suite, 2020.
  9. Erling Rennemo Jellum, Torleiv Håland Bryne, Tor Arne Johansen, and Milica Orlandíc. The syncline model-analyzing the impact of time synchronization in sensor fusion. arXiv preprint, 2022. URL: http://arxiv.org/abs/2209.01136.
  10. Phil Koopman. A case study of Toyota unintended acceleration and software safety. Presentation. Sept, 2014. Google Scholar
  11. Karl Koscher, Alexei Czeskis, Franziska Roesner, Shwetak Patel, Tadayoshi Kohno, Stephen Checkoway, Damon McCoy, Brian Kantor, Danny Anderson, Hovav Shacham, and Stefan Savage. Experimental security analysis of a modern automobile. In 2010 IEEE Symposium on Security and Privacy, pages 447-462, 2010. URL: https://doi.org/10.1109/SP.2010.34.
  12. Edward A. Lee. The problem with threads. Computer, 39(5):33-42, 2006. Google Scholar
  13. Edward A. Lee and Sanjit A. Seshia. Introduction to Embedded Systems - A Cyber-Physical Systems Approach. MIT Press, Cambridge, MA, USA, second edition, 2017. URL: http://LeeSeshia.org.
  14. Nancy G. Leveson and Clark S. Turner. An investigation of the Therac-25 accidents. Computer, 26(7):18-41, 1993. Google Scholar
  15. Hendrik Marten Frank Lohstroh. Reactors: A deterministic model of concurrent computation for reactive systems. University of California, Berkeley, 2020. Google Scholar
  16. Marten Lohstroh, Christian Menard, Soroush Bateni, and Edward A. Lee. Toward a lingua franca for deterministic concurrent systems. ACM Trans. Embed. Comput. Syst., 20(4), May 2021. URL: https://doi.org/10.1145/3448128.
  17. David May. The XMOS architecture and XS1 chips. IEEE Micro, 32(6):28-37, 2012. Google Scholar
  18. Tommi Mikkonen and Antero Taivalsaari. Web applications - spaghetti code for the 21st century. In 2008 Sixth international conference on software engineering research, management and applications, pages 319-328. IEEE, 2008. Google Scholar
  19. George Robotics. MicroPython - Python for microcontrollers. https://micropython.org, 2022.
  20. Abhiroop Sarkar, Bo Joel Svensson, and Mary Sheeran. Synchron - an API and runtime for embedded systems, 2022. URL: https://doi.org/10.48550/arXiv.2205.03262.
  21. Nordic Semiconductor. nRF52 DK. https://www.nordicsemi.com/Products/Development-hardware/nRF52-DK, 2022.
  22. Douglas Watt. Programming XC on XMOS devices. XMOS Limited, 2009. Google Scholar
  23. Gordon F. Williams. Making Things Smart: Easy Embedded JavaScript Programming for Making Everyday Objects into Intelligent Machines. Maker Media, Inc., 2017. Google Scholar
  24. W. Wulf and Mary Shaw. Global variable considered harmful. SIGPLAN Not., 8(2):28-34, February 1973. URL: https://doi.org/10.1145/953353.953355.
  25. Weiwei Xiong, Soyeon Park, Jiaqi Zhang, Yuanyuan Zhou, and Zhiqiang Ma. Ad hoc synchronization considered harmful. In Proceedings of the 9th USENIX Conference on Operating Systems Design and Implementation, OSDI'10, pages 163-176, USA, 2010. USENIX Association. Google Scholar
  26. Zephyr. Message Queues. https://docs.zephyrproject.org/3.2.0/kernel/services/data_passing/message_queues.html, 2022.
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail