Features of the Implementation of Multitasking on the Raspberry Pi and Arduino Platforms
DOI:
https://doi.org/10.31649/1997-9266-2022-164-5-80-85Keywords:
embedded, Arduino, Raspberry Pi, microcontroller, microcomputer, embedded systems, multitasking, process, threadAbstract
The most popular platforms for developers of embedded systems among beginners are Arduino and Raspberry Pi. These platforms are different and have different purposes, but both may need to perform multiple operations in parallel. The article shows ways to implement multitasking on the above-mentioned platforms. Since Arduinos are mostly based on single-core AVR microcontrollers, with a rather low clock frequency, the multitasking of this platform is only conditional. Time-consuming operations will occupy the only core and the only thread of the microcontroller, which will not allow doing anything else. This does not apply to the hardware components of the microcontroller, such as timers, which work independently from the software part and allow the implementation of short tasks with a fixed period. There are libraries for simply writing a program that uses such controller capabilities. The most famous of them is TimedAction, which can be found on the official Arduino website. Also, most microcontrollers have a hardware input that can be used to generate software interrupts. During the interruption, operations can also be performed, after the completion of which the work of the main loop of the program will be resumed. On the Raspberry Pi, as on similar microcomputers running the Linux OS, you can fully consider threads and processes. A process is an instance of a program and is created by the operating system. Individual processes do not share a common memory. Parallel processes are used when complex calculations need to be accelerated. Threads are subtasks, which can be several within a process. There is a common amount of memory between several threads, which allows convenient data exchange. Parallel threads are used when you need to perform long I/O operations. In the Python language, which is widely used in embedded systems, the Threading library is used to implement multithreading. A feature of multitasking in Python is the Global Interpreter Lock. This mechanism ensures that the code of only one application process will be executed at a time. This feature of Python has supporters and detractors, as well as advantages and disadvantages.
References
J. Marot, and S. Bourennane, “Raspberry Pi for image processing education,” 2017 25th European Signal Processing Conference (EUSIPCO), 2017, pp. 2364-2366, https://doi.org/10.23919/EUSIPCO.2017.8081633 .
V. Bharadwaja, R. Ananmy, S. Nikhil, K. V. Vineetha, J. Shah, and D. G. Kurup, “Implementation of Artificial Neural Network on Raspberry Pi for Signal Processing Applications,” in 2018 International Conference on Advances in Computing, Communications and Informatics (ICACCI), 2018, pp. 1488-1491, https://doi.org/10.1109/ICACCI.2018.8554887 .
A. P. Jadhav, and V. B. Malode, “Raspberry PI Based OFFLINE MEDIA SERVER,” 2019 3rd International Conference on Computing Methodologies and Communication (ICCMC), 2019, pp. 531-533, https://doi.org/10.1109/ICCMC.2019.8819718 .
D. Eridani, and E. D. Widianto, “Performance of Sensors Monitoring System using Raspberry Pi through MQTT Protocol,” in 2018 International Seminar on Research of Information Technology and Intelligent Systems (ISRITI), 2018, pp. 587-590, https://doi.org/10.1109/ISRITI.2018.8864473 .
А. В. Бруско, «Інтерактивний логотип,» в матер. ІV Всеукраїнської науково-технічної конференції студентів та аспірантів «Радіоелектроніка у ХХІ столітті», 25-26 травня 2021 р., Київ, Україна, КПІ ім. Ігоря Сікорського, РТФ. Київ : КПІ ім. Ігоря Сікорського, 2021, с. 19-20.
С. Б. Могильний, Мікрокомп’ютер Raspberry Pi — інструмент дослідника. Київ, Україна: Талком, 2014. 340 с.
О. Ю. Мирончук, О. О. Шпилька, Д. Д. Струков, А. А. Петровський, і А. О. Герасименко, «Застосування нейронної мережі для оцінювання частотної характеристики багатопроменевого каналу в системах зв’язку з технологією OFDM,» Вісник Вінницького політехнічного інституту, № 4, с. 99-104, Серп. 2021.
Xinmin Tian, Yen-Kuang Chen, M. Girkar, S. Ge, R. Lienhart, and S. Shah, “Exploring the use of Hyper-Threading technology for multimedia applications with Intel/spl reg/ OpenMP compiler,” Proceedings International Parallel and Distributed Processing Symposium, 2003, pp. 8. https://doi.org/10.1109/IPDPS.2003.1213118 .
H.-W. Huang, The Atmel AVR Microcontroller: MEGA and XMEGA in Assembly and C. Cengage Learning, 2013, 816 p.
D. Bovet, and M. Cesati, Understanding the Linux Kernel, Janaury 2001. OŔeally & Associates, Sebastopol (2001)
B. J. Catanzaro, Multiprocessor system architectures. Englewood Cliffs, N.J : PTR Prentice Hall, 1994.
G. P. Duggan, and P. Young, “Precision timing on low-cost Linux microcomputers,” in 2015 Annual IEEE Systems Conference (SysCon) Proceedings, 2015, pp. 469-471, https://doi.org/10.1109/SYSCON.2015.7116795 .
A. Martelli, and D. Ascher, Eds., 2002. Python Cookbook. Sebastopol: O'Reilly. ISBN: 0-596-00167-3 .
D. Saito, H. Washizaki, Y. Fukazawa, T. Yoshida, I. Kaneko, and H. Kamo, “Learning Effects in Programming Learning Using Python and Raspberry Pi: Case Study with Elementary School Students,” in 2019 IEEE International Conference on Engineering, Technology and Education (TALE), 2019, pp. 1-8, https://doi.org/10.1109/TALE48000.2019.9225866 .
Downloads
-
PDF (Українська)
Downloads: 139
Published
How to Cite
Issue
Section
License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).