Designing Embedded Communications Software

Recall the discussion about accessing global variables via access routines instead of pointers. This approach allows controlled access, in which mutual exclusion can be enforced.
When moving to a distributed environment, there are two options for accessing the variables:
Maintain the access routine paradigm. Individual tasks will continue to call the access routines, but the routines will make a remote procedure call to obtain the information, assuming that the data structure is on a different card.
Have a local copy of the data structure, and replicate the access routines on both cards. This requires synchronization of the two copies of the data structure.
Figure 8.5(a) details this access routine scenario. The data structure is stored on the control card, and the access routine is implemented in a separate task, so that all access to the data structure is through messages. For both control and line card tasks, the messaging infrastructure takes care of the abstraction.
Figure 8.5(b) details the local copy scenario. The data structures are replicated in both cards, and the access is completely local. This avoids the overhead of messaging across the backplane for basic access to the data structures. However, the data structures need to be synchronized; for every change in one data structure, there needs to be a corresponding change in the other data structure. This can be difficult to maintain when there is a large number of cards which replicate the data structure information.