A Flexible Resource Manager, or FRM, enables multiple clients to share disparate
resources, including database connections, communication ports and tasks for multiple
clients. The approach balances performance issues, such as the latency introduced
by resource allocation, with the overhead of retaining unused resources, while
providing for demand-based allocation, reuse of already allocated resources, and
removal of resources under the control of an aging parameter. During registration,
each resource object class and its corresponding constructor parameters are stored,
and a resource pool is configured to contain a maximum and minimum number of instances.
When registration completes, the FRM returns back a unique identifier that the
application can use request instances of these resources in the future. Drivers
or other dependent resources supporting the managed resource are only loaded when
needed, thereby conserving memory and processing overhead.