Threads in Embedded Linux- 6 Easy Pieces - Loïc Domaigné, Doulos
Channel: The Linux Foundation
Date: 12/07/2023

Threads in Embedded Linux- 6 Easy Pieces - Loïc Domaigné, Doulos

Processes, Light-weight processes, (green) threads, fibers, co-routines, tasks, you named it. All these names refer to programming models for implementing concurrent processing efficiently. In this talk, Loïc is going to provide you a map of how to navigate the threads landscape on Linux. The talk starts with a brief review of the clone(2) system call, and how this translates to processes and threads at user-space level. It then reviews the thread life cycle (creation, joining, detaching, exiting), followed by a focus on the thread stack and size and illustrates how glibc and musl differ in that regard. Loïc then discusses memory synchronization, mutexes and condition variables and shows typical use. The talk concludes by looking at threads and signal delivery. This is a practical hands-on talk, so we'll demo (broken-) code, look under the hood what's going on using tools like pmap, strace, ltrace,.. and possibly will have a peek at some musl or glibc code implementation! Featuring: Help, compiling with "-pthread" breaks my non-threaded code! When threads strike and refuse starting. Did you say stack size? Aren't mutex just binary semaphore? What's the condition in condition variable? There was once a happy bunch of threads in a process, suddenly a signal is delivered…