What are the threads associated with HSL 2.0 devices?
1.Threading concept HSL20
There are the following thread contexts with which an HSL 2.0 device comes into contact:
1.1.Thread 1 - The logic thread
The HomeServer logic engine runs in a single thread.
In order not to influence the logic in its runtime, an HSL 2.0 module runs in a different thread context (thread 2).
Therefore the framework arranges all input telegrams of an HSL 2.0 block in a queue.
Within the logic thread (Thread 1) the processing of the device is finished.
In order not to influence the logic in its runtime, an HSL 2.0 module runs in a different thread context (thread 2).
Therefore the framework arranges all input telegrams of an HSL 2.0 block in a queue.
Within the logic thread (Thread 1) the processing of the device is finished.
1.2.Thread 2 - The HSL 2.0 context thread
Each HSL 2.0 module determines a context in which it runs. This context is separated from the rest of the logic by its own thread. Within this thread the queue is processed, which contains the input telegrams inserted by thread 1, as well as all calls of callback methods provided by the framework.
This ensures that within a thread/context only one method is running at a time.
This ensures that within a thread/context only one method is running at a time.
Attention
To keep the load on the device low, all blocks within a thread should share a context!