In C++ -with-Ease marshalling functions may be supplied to convert data to/from a binary stream for exchange between processes. As well as this, the Ease library calls the appropriate constructors/destructors and operators to copy and create objects. This is acheived by creating small functions which call the appropriate operators and passing pointers to these functions to the Ease library (which is written in C). Then, instead of executing appropriate malloc and binary copy calls these functions may be called.
Table 5.1 shows operations performed when exchanging data between processes. If the source and destination are both local pointers (i.e. @put! and @get! both execute in a single cell) then the data is exchanged by reference. If the destination is local but not a pointer then the assignment operator is used. If the source is a local object and the destination a local pointer then the copy constructor is called. If the destination is remote then the data is marshalled, unmarshalled and appropriate new/delete's are called.
Destination
Source
| Local *b | Local b | Remote b | Remote *b | |
| marshal *a | marshal *a | |||
| Local *a | b = a | operator= | delete a | delete a |
| delete a | unmarshal b | b = new T | ||
| unmarshal b | ||||
| marshal a | marshal a | |||
| Local a | b = new T(a) | operator = | unmarshal b | b = new T |
| unmarshal b |
Next: Porting C-with-Ease
Up: Implementation
Previous: Scheduling