# Synchronization

Next: Type Introduction, Previous: Process Selection, Index: Index

The synchronization statement will synchronize all processes who encouter it. Synchronization is defined as completing communications which have been issued yet no response from the other party(s) have occured. It is therefore only useful for asynchronous communication - synchronous communication is, by its very nature, synchronous. All the synchronization statement does is to wait at that point for the completion of asynchronous communication, it DOES NOT add in any extra communications for force all processes to wait at that point as that is considered pointless.
sync;
sync [varname];
In the first instance, sync alone will synchronize for all asynchronous communications. Followed by a variable name it will synchronize for just those async communications associated with that variable. If a variable receives data via asynchronous communication, and this value is used without synchronizing then, even though this will compile, a warning is issued stating that the value might infact be dirty. If a synchronisation is issued for a variable where no async communication has been used then a warning will also be given for this pointless statement.
See the async[] type for further information and examples of using both asynchronous communication and synchronization.
Last Modified: August 2008