|
2 | 2 | slug: decentralized-consistency |
3 | 3 | title: "Decentralized Consistency" |
4 | 4 | authors: [fra-p, eal, rcakella] |
5 | | -tags: [lingua franca, federation, decentralized, consistency, STA] |
| 5 | +tags: [lingua franca, federation, decentralized, consistency, maxwait] |
6 | 6 | --- |
7 | 7 |
|
8 | 8 | The design of [distributed applications](/docs/writing-reactors/distributed-execution) in Lingua Franca requires care, particularly if the coordination of the federation is [decentralized](/docs/writing-reactors/distributed-execution#decentralized-coordination). The intent of this post is to illustrate and handle the challenges arising from designing distributed applications in Lingua Franca, with the help of two realistic use cases. |
@@ -40,7 +40,7 @@ But how long should it wait? |
40 | 40 | The decentralized coordinator in |
41 | 41 | Lingua Franca allows you to customize this waiting time. Each federate can be assigned an attribute called [`maxwait`](/docs/writing-reactors/distributed-execution#safe-to-advance-sta) that controls how long the federate should wait for inputs from other federates before processing an event, such as an input it has just received. |
42 | 42 | More precisely, `maxwait` is the maximum amount of time a federate waits before advancing its logical time to some value _t_. Specifically, to advance to logical time _t_, the federate waits until either all inputs are known up to an including time _t_ or its local physical clock exceeds _t_ +`maxwait`. |
43 | | -An input is known up to an including time _t_ if message with timestamp _t_ or greater has been received on that input port. |
| 43 | +An input is known up to an including time _t_ if a message with timestamp _t_ or greater has been received on that input port. |
44 | 44 | At the expiration of the `maxwait`, the federate assumes that any unresolved ports will not receive any messages with timestamps _t_ or earlier. |
45 | 45 | It can then advance its logical time to _t_. |
46 | 46 |
|
@@ -99,7 +99,7 @@ federated reactor { |
99 | 99 |
|
100 | 100 | The `maxwait` attribute is specified at instantiation time within the main reactor. Right before creating the instance of the `Door` reactor for which we want to set the attribute, we use the `@maxwait` annotation that takes as input the `maxwait` value. |
101 | 101 |
|
102 | | -The reactions of the `Door` reactor provide [fault handlers](/docs/writing-reactors/distributed-execution#safe-to-process-stp-violation-handling) that are invoked in case the the federate assumed inputs were known up to timestamp _t_ and then later received a message with timestamp _t_ or less. When `maxwait` is `forever`, these fault handlers should never be invoked. |
| 102 | +The reactions of the `Door` reactor provide [fault handlers](/docs/writing-reactors/distributed-execution#safe-to-process-stp-violation-handling) that are invoked in case the federate assumed inputs were known up to timestamp _t_ and then later received a message with timestamp _t_ or less. When `maxwait` is `forever`, these fault handlers should never be invoked. |
103 | 103 |
|
104 | 104 | For finite values of `maxwait`, it is always possible for messages to get sufficiently delayed that the fault handlers will be invoked. |
105 | 105 | When they are invoked, the current tag will be greater than the intended tag of the message. |
|
0 commit comments