Next: 16.2.5 Zipcode Calls
Up: 16.2 Low-Level Primitives
Previous: CE Programs
The RK calls required by Zipcode are as follows:
- msg = xmalloc(int length) allocates a message buffer of
length bytes and
returns a pointer msg to it;
- xfree(char *msg) deallocates the message buffer pointed to by
msg;
- xlength(char *msg) determines the length (in bytes) of a
previously
allocated or received message msg;
- msg = xrecv() receives a message without blocking ,
returning a pointer
to the message if a message can be received and NULL if there
is no message queued to the calling process;
- msg = xrecvb() blocks until a message can be received and
returns a
pointer to the message;
- xsend(char *msg, int node, int pid) sends a message pointed to
by msg
to the process pid on node node; and
- xmsend(char *msg, int count, int *dest) sends a message msg to multiple
destinations specified by the integer array dest of length 2*count
in the form { node0, pid0, node1, pid1, ...} .
It is important to note that xsend() and xmsend() deallocate
the message buffer after sending the message; they are
semantically analogous to xfree(). The receive functions
xrecv() and xrecvb() are semantically analogous
to xmalloc().
Zipcode-based programs are not to call any of these CE or
RK
functions directly. Both message passing and environment control
are represented in Zipcode.
Guy Robinson
Wed Mar 1 10:19:35 EST 1995