How does the Apache process and thread architecture effect my filter?
Your filter code should expect to run in any of the Apache Multi-Processing Modules (MPM) environments. Depending on how Apache has been configured, the process in which your filter is running may be one of many running the Apache server, and may have many threads running in the process. Your filter will be initialised every time a process is created, which may be quite often, again depending in Apache configuration and on server load. With the multi-threaded MPMs, you must be aware that several threads of execution could be concurrently running in your filter, and hence use interthread locking where appropriate (see Thread Safety, and the APR Thread Mutex and Atomic operations). But imagine you wish to share a connection pool or heavy-weight structures been instances of your filter across Apache process. In this case you can use the APR’s abstraction of shared memory or “backing storage” such as disk files or external databases. It is a common misconception to think that filters runni