Using callable cell pool services

The following topics describe how you can use callable cell pool services to control storage and request information about the cell pools. The discussion of creating a cell pool and adding an extent assumes that you have already obtained the storage for these areas.

To create a cell pool, call the CSRPBLD/CSRC4BLD service. This service initializes the anchor for the cell pool, assigns the name of the pool, and establishes the size of the cells.

To add an extent and connect it to the cell storage, call the CSRPEXP/CSRC4EXP service. You need at least one extent in a cell pool. Each extent is responsible for one cell storage area. You can add an extent to increase the numbers of cells; the maximum number of extents in a cell pool is 65,536. The CSRPEXP/CSRC4EXP service initializes an extent for the cell pool, connects the cell storage area to the extent, and activates the cell storage for the extent.

Having activated the cell storage for an extent, you can now process GET requests from the cells that the extent represents.

To contract a cell pool, deactivate its extents, and disconnect its storage, use the CSRPDAC/CSRC4DAC and CSRPDIS/CSRC4DIS services. CSRPDAC/CSRC4DAC deactivates an extent and prevents the processing of any further GET requests from the storage that the extent represents. Cell FREE requests are unaffected. (You can use the CSRPACT/CSRC4ACT service to reactivate an inactive extent; reactivating undoes the effect of using CSRPDAC/CSRC4DAC.)

CSRPDIS/CSRC4DIS disconnects the cell storage from an extent and makes cell storage unavailable. After you disconnect an extent, you can free the cell storage associated with the extent. Do not free the extent itself until you have finished using the entire pool.

To reuse a deactivated, disconnected extent, call the CSRPCON/CSRC4CON and CSRPACT/CSRC4ACT services, not CSRPEXP/CSRC4EXP. This is generally the only time you will need to use these two services. CSRPCON/CSRC4CON reconnects an extent to cell pool storage that you have not explicitly freed or that connects the extent to cells in newly-obtained storage. If you reconnect the extent to new cell storage, be sure that the extent is large enough to support the size of the cell storage. (CSRPCON/CSRC4CON undoes the effects of using CSRPDIS/CSRC4DIS.) CSRPACT/CSRC4ACT activates the cell storage for the extent. You can now issue GET requests for the cells.

To allocate (or obtain) cells and deallocate (or free) previously allocated cells, you have a choice of two forms of the same services. One service form supports the standard CALL interface. The other supports a register interface and is appropriate for programs that cannot obtain storage for a parameter list. The two service functions are identical; however, the calling interface is different.

The CSRPGET/CSRC4GET (standard CALL interface) and CSRPRGT/CSRC4RGT (register interface) services allocate a cell from the cell pool. You can allocate cells only from extents that have not been deactivated. Such an extent is called an active extent. The services return to the caller the address of the allocated cell. The CSRPGT1/CSRC4GT1 and CSRPGT2/CSRC4GT2 (standard CALL interface) and CSRPRGT1/CSRC4RG1 (register interface) services provide the same function with slightly improved performance.

The CSRPFRE/CSRC4FRE (standard CALL interface) and CSRPRFR/CSRC4RFR (register interface) services return a previously allocated cell to a cell pool. They return a code to the caller if they cannot find the cell associated with an extent. If you free the last allocated cell in an inactive extent, you will receive a unique code. You may use this information to initiate cell pool contraction. The CSRPFR1/CSRC4FR1 and CSRPFR2/CSRC4FR2 (standard CALL interface) and CSRPRFR1/CSRC4RF1 (register interface) services provide the same function with slightly improved performance.

To obtain status about a cell pool, use one of three services. These services do not prevent the cell pool from changing during a status query. They return status as it is at the time you issue the CALL.

The CSRPQPL/CSRC4QPL service returns information about the entire cell pool. It returns the following:
The CSRPQEX/CSRC4QEX service returns information about a specific extent. It returns the following:
The CSRPQCL/CSRC4QCL service returns information about a cell. It returns the following: