Shared records in Memo

Th Christopher
Memo home page

Memo Prog Tech

Shared records. The essential way to share a record among the parallel processes is to write the record as a memo into a folder whose name all the processes know. Any process that wishes to read the record can get a copy of the memo. Shared records are updated by getting them from their folders, examining and updating them, and putting them back. While the record is being updated, its folder is empty, and any other process trying to access it will have to wait; the records are implicitly locked. The following exemplifies operations on shared records:

FOLDER_NAME obj_name;
OBJECT *p;
...
p = (OBJECT *) memo_get(obj_name);
... /* operate the object p */
memo_replace(p);

 

Distributed arrays. Arrays of shared objects may be created similarly. The element a[i,j] can be stored in a folder whose name, key, is constructed thus:

FOLDER_NAME key;
SYMBOL a;
...
a = memo_symbol();
key.S = a;
key.X[0] = i;
key.X[1] = j;
key.X[2] = 0;

This page last updated 09/30/97