next up previous contents
Next: Multi-Processing Modules Up: The Apache HTTP Server Previous: Configuration   Contents

Apache Portable Runtime

Apache provides programmers with a so-called Apache Portable Runtime (APR). It aims at creating an abstraction of operating system, which makes the modules independent from the underlying architecture. There are many OS-specific versions of APR. All of them, however, implement the same interface, which can be used by module developers.

To mention at least a part of what APR offers, there are routines for memory allocation, network communication, locking, and logging. APR uses its own abstraction of memory (both private and shared), network connections, and files. It comes with a huge set of functions useful for data management, like operations on strings and generic data structures. All these facilities make module development easier, and the final code portable across Apache servers.

A special data structure that is available in APR is a resource pool. It is a collection of miscellaneous resources, including, for example, memory chunks and file descriptors. Pools help manage the allocated resources and allow to release them once they are no longer needed. A typical example of the application of pools is to associate a separate pool with each client connection so that resources needed only for the connection processing are released right after the connection is closed. We can perceive this mechanism as a specialized garbage collector.


next up previous contents
Next: Multi-Processing Modules Up: The Apache HTTP Server Previous: Configuration   Contents
root 2002-08-27