next up previous
Next: Use of UC++2 Up: Utility Functions Previous: Blocking on an

Synchronization Functions

At present it is not clear how we pass information back to UCPP_main in general: the only way to do so is for UCPP_main to ask other active objects for data with synchronous non-void rmeote method invocations. However, for this to work it is necessary for UCPP_main to synchronize with the object it wants to get data from. To allow this we provide three utility functions:

{\tt void WaitForSynchronize(Activatable *a);}

This puts the object (either the UCPP_main function or a function called from it in a wait state until a synchronization mesage is received from active object a.

void SendSynchronize(Activatable *a)

This sends a synchronization message to active object a, which must be executing a WaitForSynchronize message from this object or there is a logic error (not clear yet if there is any good reason why this situation may arise).

void SendSynchronizeMain();

This is the equivalent of SendSynchronize above, but sends the message to UCPP_main. This is the only way that an active object can proactively signal UCPP_main.

These synchronization functions are rather a hack to get raound certain problems with the fact that UCPP_main is not an active object and certain related difficult situations. It is hoped that as the model developes these will not be required.

send comments or suggestions to

Click here for more information on UCL-CS.