in reply to problem porting to threaded mode

Apache provides a number of hooks that can be used during the different stages of process spawning and request handling (mostly relevant to the worker model). I've done this using the APR C API but not with mod_perl. (There seems to be little documentation on such advanced use in mod_perl).

If you are intending to open a resource that you want to share across threads within a process have you considered writing the appropriate code for the PerlChildInitHandler callback? Once you've opened your resource you could store a handle to it in the Process (see Apache2::Process) memory pool (see Apache2::Pool). When you get to your PerlResponseHandler you would then make use of the handle stored in the Process memory pool (with appropriate locking, of course, to protect against multiple thread access).

I cannot find any concrete examples to show you, nor do I know if this is actually technically possible using mod_perl.

Update: adjusted formatting.