Thread Synch AOSV 2020
1.2
LKM for exchanging messages between threads
|
This module for Linux kernel allows threads to subscribe to a group in order to exchange messages and synchronize between each other. In simple terms, the entire subsystem can be divided into the following sub-modules:
For user-level library documentaion see this page.
For kernel-level code documentation see this page.
For benchmarking file options see this page.
Messages in a group are delivered to readers in FIFO order. Threads can subscribe to a group’s messages and when they do they become an “active member” of that group.
When a thread reads a message, the module adds its PID to the message’s list of recipients. Later, the garbage collector will traverse the messages FIFO queue and compare the set of message’s recipients with the set of active members: if active members are a subset of a message’s recipients, the message is removed and memory is freed.
Each group has a field that describes its owner: an owner is represented by an UID that corresponds to the user that installed the group. By default any threads can edit the group’s parameters both through the “sysfs parameter config system” and by interacting with the group's facilities (via ioctl). To prevent this, it is possible to set the “strict mode” flag of a group: when this flag is active, only the current owner of a group can modify its internal parameters.