>> I would assume that subsequent callers could use apr_shm_attach to then >> attach to an existing shared memory segment, however, it appears that this >> function is not used anywhere in the apache (2.2) code base whatsoever. >> (It is used in one or two places in 2.3).
> I assume you don't see it in HTTP server because everyone inherits a > reference to shared memory created in the parent process. Of course > outside of this you don't always have such a relationship. > > Maybe the testshm* in apr/test/ would be a good resource? The APR > tests are always easy to tinker with. Ah...I am 99% with you. So the calls I am seeing are only made by the parent process? So I am assuming the parent process fork()s other processes, but the *shared memory* pages are not subject to the Copy-on-Write handling as the rest of the processes pages are? So - if I follow other examples - if I were to create the shared memory segment in a ap_hook_post_config hook function, it would be assured to be set-up before any child processes are forked, and inherited by them? Thanks for the help. -BKG