How TDRP works

There are two main components of the system in memory: The table is a static array in the _tdrp.c module for C, or a private array in the Params class in C++. The init() function loads up the table with the default values. The read() function then takes values from the parameter file and writes over the defaults.

Stored in the table are offsets from some reference address in memory to the address of the parameter in user space. At the end of the read() function the values in the table are copied across from the table into user space, using the offset to compute the user-space address.

From then on the program deals with the parameters in user space. If changes are made to parameter values this is done in user space.

Prior to a print of the parameters, the values are copied back from user space to the table via the sync() function.