GDSX Manual
Design and Development
Extended General Device Support (GDSX) Manual–134303
2-13
Memory Management
plus the TSCODE-supported utility procedures ^CHECKPOINT, DO^CP, FAULT, 
STOP^TASK, WAITED^IO[X], and WAIT^EVENT need to be considered when 
determining when a task will be suspended. 
USCODE must communicate with external requesters by calls to ^READUPDATE[X] 
and REPLY[X] on pseudo-$RECEIVE files created and managed by TSCODE for the 
DEVICE^HANDLER tasks. See the tutorial in Section 5 for details. 
Memory Management
Because the working stack images of tasks are swapped to and from an extended data 
segment, I/O operations must be performed by means of global buffers, and large 
amounts of data local to tasks are best maintained somewhere other than the tasks’ stack 
images. To facilitate the efficient use of memory by both TSCODE and USCODE, 
TSCODE provides local memory pools and extended data segment memory pools, as 
well as the following memory pool management procedures:  
In order to be consistent with TSCODE, when managing the available global memory 
pools, USCODE should use these procedures rather than another means. For further 
information on these procedures see Section 8, “Service Routines.” For further 
information on memory pools, see "Memory Pools" on page 2-23.
Although it is not generally advisable, USCODE can use its own extended segment 
through calls to ALLOCATESEGMENT and USESEGMENT.  The segment IDs 
available to USCODE range from 0 through 1023. Such a segment cannot be 
checkpointed with a call to ^CHECKPOINT(2), so this kind of space should be 
considered temporary working storage.  
Intertask Communication
TSCODE provides a set of procedures to support communication between TSCODE and 
USCODE, and communication among user tasks. These procedures make it possible for 
a DEVICE^HANDLER task to communicate with other DEVICE^HANDLER or 
LINE^HANDLER tasks, and for a LINE^HANDLER task to communicate with other 
LINE^HANDLER tasks.
The procedures also provide a mechanism for a LINE^HANDLER to efficiently handle 
several different types of asynchronous events. The WRITE^ITC^MESSAGE[X] 
GETEXTPOOL
GETEXTPOOLX
GETLOCALPOOL
PUTEXTPOOL
PUTLOCALPOOL
Caution. TSCODE expects that if USCODE changes the segment ID from m to n, immediately 
after USCODE next relinquishes control, the segment ID has been restored to m. Therefore, 
once a user task is using its own segment, it must not relinquish control until the previous 
segment ID has been restored. 










