Here's a patch just to give you an idea of what I'm thinking. It compiled. This is more to get some ideas going to see how/iff this fits into mod_lua.
The biggest issue is that the package_paths are per_dir and in post_config, you can't really get at those in a useful way. I "precompile" all of the server scoped handlers in post_config so that there is no worry about that once we start taking requests. This just makes an array of pools sized at thread_limit, so that basically each thread has it's own pool. I use the connection->id to determine what thread a request is running in, bcs there is no real way to get at that. I used worker here, so this may not work anywhere else as it's tied to how worked calculated the connection->id. Since the pool is per thread, we don't have to worry about any locking (in worker at least). --bakins
mod_lua-server-scope.diff
Description: Binary data
