Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

Suspending and Dispatching Thread Procedures
3-34
109759Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
I Process Development Process
IF (error := _FOBJECT^INIT (cx.outobj.FOBJ,,
cx.inobj.FOBJ))
THEN ... <error exit> ;
cx.outobj.FOBJ.Z^RESULT := <status of subordinate>;
cx.outobj.FOBJ.Z^OBJTYPE ':=' <type of subordinate>;
cx.outobj.FOBJ.Z^OBJNAME ':=' <name of subordinate>;
_RELEASE^OUTPUT (cx.outobj);
...
END;
Suspending and Dispatching Thread Procedures
The command thread must periodically suspend execution until something occurs; then
it continues at the point it left off. To temporarily suspend execution, such as for CI I/O,
the thread returns an _RC^WAIT return code to the frame.
The driving mechanism for dispatching a thread is the occurrence of an event, at which
point the frame calls the current thread procedure, which is entered at the top. (Any
procedure that is a candidate to be dispatched as part of a thread must be declared with
_THREAD^PROC and _END^THREAD^PROC.)
The command thread may return to the frame for the express purpose of having a new
thread procedure dispatched (see “State Management,” later in this section).
Thread procedures may also call utility procedures, which are not thread procedures.
Suspending Thread Procedures: Return Codes
When a thread procedure cannot or should not proceed, it returns one of the following
return codes to the frame:
_RC^WAIT Redispatch the current thread procedure on the next event.
_RC^STOP The command completed normally.
_RC^ABORT (error) The command terminated abnormally. error is a ZDSN^ERR
value indicating the reason for the abnormal command
termination. See Appendix B, “DSNM Error Codes.
Note. The library functions _DISPATCH^THREAD, _SAVE^THREAD^AND^DISPATCH, and
_RESTORE^THREAD^AND^DISPATCH also result in a return to the frame with an _RC^WAIT
return code. See “State Management” for more information on library functions.