Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
I Process Development Process
Distributed Systems Network Management (DSNM) Subsystem Interface Development
Guide—109759 3-37
State Management
In the following example, a thread procedure calls an _RC^TYPE procedure. The called
procedure returns a frame return code, which is interpreted by the calling procedure.
_RC^TYPE PROC process^object ( ... );
BEGIN
.
.
END;
_THREAD^PROC (_COMMAND^PROC);
BEGIN
_RC^TYPE obj^rc;
.
.
obj^rc := process^object ( ... );
IF obj^rc <> _RC^NULL
THEN
RETURN obj^rc;
.
.
_END^THREAD^PROC;
State Management
As described earlier, each thread is allocated a context space when created. The context
space exists until the thread terminates. The command context space and all
dynamically allocated memory areas are preserved between dispatches of the thread.
Local variables are not preserved between dispatches and must be reinitialized after any
dispatch before they are used. Global variables are shared among all concurrently
executing threads. There is no way for the user to order dispatching among active
concurrent threads; therefore, only read-only globals are practical as a general rule.
When the frame dispatches a thread, the current thread procedure is always entered from
the top. It is up to the thread procedure to determine its current state from the event that
occurred and from information it has kept in its command context area.
The frame maintains the following state variables:
•
Event(s) that caused the current dispatch
•
Current thread state
•
Current thread procedure