Connection priority

The 1.6 kernel introduced the notion of connection priority. Each connection is associated with a priority value between -100 and 100. At each cycle, the URBI code from all connections is executed, starting with the connection having the highest priority. If the execution time exceeds the interval between two cycles, minus a small margin, the execution is interrupted until next cycle.

This feature can be used to prevent important code that needs to be executed periodicaly (equilibrium, safety checks...) from being disturbed in case of CPU overload.

As a conveniance, the URBI Server starts a connection on startup, with a priority of 80, and loads the file URBIRT.INI. The ID of this connection is stored in the variable connection.ghostRTID, for use by +connection.

To set the priorty of a connection, write

setpriority <PRIO> ;
.

The list of opened connections and their respective priority can be displayed by the connections keyword.

Once all the high-priority code is set up, you might want to prevent new code from being added with high-priority values. This can be done by calling once the seal keyword. Once called, no connection can be set with a positive priority value, and no code can be written to connections with a higher priority value with +connection:

setpriority 20;
seal;
setpriority 30;
[12345678] !!! 4.1-14: cannot set positive priority in sealed kernel