AMX Buffer Manager
K
A
DAK
119
9. AMX Buffer Manager9.1 Introduction
The AMX Buffer Manager simplifies the management of memory buffers in a real-time
system. It provides a general mechanism for the allocation and control of fixed size
buffers.
The AMX Buffer Manager provides fast, efficient access to multiple pools of buffers,
each buffer representing a fixed size block of memory. This form of memory
management meets the requirements of most typical applications and is best suited for
real-time use in which memory block availability must be predictable and in which the
penalties for memory fragmentation cannot be tolerated.
You define a set of buffer pools, each pool containing a set of buffers of uniform size.
Buffer Manager procedures are called to obtain a buffer from a particular pool and to
release it back to the pool when it is no longer required.
When released, the buffer is automatically returned by the Buffer Manager to the pool to
which the buffer belongs. Buffer ownership can be increased so that more than one task
can simultaneously own a shared buffer. Special facilities are provided to assure that if a
buffer is owned by more than one task, it is only returned to its pool when the slowest
owner finally releases it.
Speed of execution is not dependent on the number of pools or buffers. The number of
buffers in a pool is limited by the fact that all buffers of a particular pool must reside in
one 64K segment. The number of pools which can be supported is limited only by
memory availability.
The AMX Buffer Manager provides the following buffer management services:
ajbcre AABCRE Create a buffer pool
ajbdel AABDEL Delete a buffer pool
ajbget AABGET Get a buffer from a specific buffer pool
ajbfre AABFRE Release a buffer
ajbgsz AABGSZ Get size of buffer
ajbau AABAU Add to buffer use count
ajbia AABIA Initialize all currently defined buffer pools
ajbip AABIP Initialize one buffer pool
ajbtag AABTAG Find buffer pool id of a buffer pool with a specific tag
Your use of the Buffer Manager is optional. If you intend to use it you must indicate so
in your System Configuration Module.
Buffer pools can be predefined in your System Configuration Module which is processed
by the Buffer Manager at startup. Buffer pools which are predefined are automatically
created by the Buffer Manager. The buffer pool id assigned to each predefined buffer
pool is stored in a variable which you must provide for that purpose.