Comparison of callable cell pool services and the CPOOL macro

Callable cell pool services are similar to the CPOOL macro, but with some additional capabilities. A program executing in any state or mode (disabled, locked, AR mode, SRB mode, etc.) can use the services to manage storage in data spaces as well as address spaces. The services allow you to define cell boundaries and to expand and contract cell pools. Another difference is in how CPOOL and the callable cell pool services handle the requests to free cells. CPOOL corrupts storage if you try to free a cell that has not been obtained (through CPOOL GET), or if you try to free a cell for a second time. Callable cell pool services accept the request, but do no processing except to return a code to your program.

Table 1 describes other differences; it can help you decide between the two ways to manage cell pools.

Table 1. Cell pool services versus the CPOOL macro, based on program requirements
If your program… Use…
Is in AR mode Cell pool services
(CPOOL has mode restrictions.)
Needs to reduce the size of a cell pool Cell pool services
(CPOOL supports expansion but only supports contraction under certain conditions.)
Needs data space storage Cell pool services
(CPOOL supports only the primary address space.)
Needs storage in an address space other than the primary Cell pool services
(CPOOL supports only primary address space storage.)
Must define cell boundaries Cell pool services
(CPOOL supports only 8-byte boundaries.)
Requires high performance on GETs and FREEs CPOOL macro
In some ways, callable cell pool services require more work from the caller than CPOOL does. For example, the services require the following actions that the CPOOL macro does not require:
  • Use the GETMAIN, STORAGE OBTAIN, or DSPSERV macro to obtain the storage area for the cell pool.
  • Provide the beginning addresses of the anchor, the extents, and cell storage areas.
  • Provide the size of each extent and the cell storage that the extent is responsible for.