Example:#include "maisie.h"
Compilation of the Parsec source file will generate an ".mo" file, containing prototypes for entities and messages. The ".mo" file will then be recompiled.
Old Format: entity job{ cpu, disk, dmean } ename disk, cpu; int dmean; { message ack { } ack1; message finish { } finish1; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .New Format: entity job{ ename cpu, ename disk, int dmean } { message ack { } ack1; message finish { } finish1; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .
If a function, say f has been defined, and is subsequently declared as a friend function within an entity, it is not necessary for the declaration to include the function prototype.
Maisie on the SP2 required every message type definition to also declare a variable of the type, even if such a variable was not required in the program. This is not necessary in Parsec.
Legal Syntax: entity job{ ename cpu, ename disk, int dmean } { message ack { } ack1; message finish{}; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .Illegal Syntax: entity job{ ename cpu, ename disk, int dmean } { message ack ack1; message finish; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .
The names of message types in a Parsec program are assumed to be global. In other words, a given identifier, say m1 can be used to define only one message type in a program. In the previous version, it was possible for a programmer to use m1 to define multiple message types (in the declaration of different entity types). Message definitions are global and the message variables are local.
Before: entity job{ ename cpu, ename disk, int dmean } { message ack { } ack1; message m1 { }; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .Recommended: message ack { }; message m1 { }; entity job{ ename cpu, ename disk, int dmean } { message ack ack1; int i, t, end, start, t_wait, tid; invoke cpu with req {self}; . . . .
Example:
extern entity entity_in_other_file { int arg1, char *arg2, float arg3[]};
For external messages, the declaration should include the message paramaters.
Example:
extern message m1_from_other_file { int a, char c, . . . };
An external function can not be declared as a friend function for an entity.
Before:sclock(void) zzcla(lookahead) zzmaxla(maxlookahead) |
Now:sclock(self) zzcla(self, lookahead) zzmaxla(self, maxlookahead) |
Example:
entity my_entity { int a, char *c, float d } [stacksize (unary_expression)]
{ . . . . };
Example:
entity channel{}
{
message wildcard m1;
wait until mtype (wildcard) {
. . . . ;
invoke receiver1 with any = msg.any;
invoke receiver2 with any = m1;
}
}
More information forthcoming as details are hammered out.
Updated: May 16, 1997.