gtpc2m47C/C++ Language Support User's Guide

glob_sync-Synchronize TPF Global Field or Record

This function synchronizes the field or record across processors in a loosely coupled complex and then unlocks the field or record. The glob_lock function must have previously been called. This function is valid only for synchronizable TPF global fields and records.

Format

#include <tpfglbl.h>
#include <c$globz.h>
void glob_sync(unsigned int tagname);

tagname
This argument, which is defined in header file c$globz.h, uniquely identifies the TPF global field or record to be synchronized.

Normal Return

Void.

Error Return

Not applicable.

Programming Considerations

Examples

The following example locks, updates and synchronizes a global field.

#include <tpfglbl.h>
#include <c$globz.h>

·
·
·
{ /******************************************************************/ /* Increment data element mysdata in synchronizable global record */ /* _mysglob. */ /******************************************************************/ struct mysglbrec **msgrptrptr = glob_lock(_mysglob); struct mysglbrec *msgrptr = *msgrptrptr; long newdata = msgrptr->mysdata + 1; glob_modify(_mysglob, &msgrptr->mysdata, &newdata, sizeof msgrptr->mysdata); glob_sync(_mysglob); }

Related Information