BAP Online Manuals : Library Reference : Library by Name : set_id
Previous: set_flush_nl
Next: shiftwindow

6.2.123. set_id

creates a process ID

SYNOPSIS

INCLUDE 'sysman.h'
set_id(ProcessID)

SYNTAX

set_id(ID, Tid, Pid) (x,x,x)

ARGUMENTS

server(ID) (o) (i) the id of a process
integer(Tid) (o) (i) Transputer Id
integer(Pid) (o) (i) Process Number

DESCRIPTION

Matches the process ID of a process identified by Tid and Pid with ID. The generated ID can be used to access the process with message predicates. set_id can also be used to extract Tid and Pid from a senderīs ID retrieved by rec_msg .

Note: set_id creates a struct of the form msg(Tid,Pid), that represents a process ID. Although this struct can be used as a process ID, this is not recommended, because the form fo this ID will change in the next version of the message and host protocol (due with the next major version change).

EXAMPLE

get_my_id(MyID),
exec(( do_something(Result), send_msg(MyID,Result) )),
do_something_else,
rec_msg(ID,Msg),
set_id(ID,Tid,_),
write("Node No. ",Tid,"returned:",Msg,nl).

ERRORS

No runtime errors.

LAYERS

client-server

RELATED PREDICATES

exec , xcall , alloc_server , get_my_id , send_msg , rec_msg


BAP Online Manuals : Library Reference : Library by Name : set_id
Previous: set_flush_nl
Next: shiftwindow