RE: child-parent memory access / mod_perl / shared mem /inter-proccesscommunication , etc..
On Mon, 24 Feb 2003, Jim Morrison [Mailing-Lists] wrote: Hmm.. Yes, it sounds pretty sketchy to me too! Immediately what I am playing with is the idea of keeping parsed XML (XML::LibXML)in memory between requests. Is this a completely barmy idea? Probably, because you'll confuse XML::LibXML's garbage collector. -- !-- Matt -- :-get a SMart net/:- Spam trap - do not mail: [EMAIL PROTECTED]
Re: child-parent memory access / mod_perl / shared mem / inter-proccesscommunication , etc..
Jim Morrison [Mailing-Lists] wrote: Sniff.. I've kind of got something working... Enough such that one httpd can request an XYZ, and if a second httpd comes along a little later and requests the same XYZ then it will get it from shared memory. I hope you used one of the modules I suggested rather than writing the whole thing from scratch. As expected though.. trying to do this with LibXML objects fails.. a lot. LibXML is an XS module, so that may interfere with serialization. CAVEAT : I know it's probably looked at as a silly idea, but if I could keep my parsed stylesheets/xml's shared somewhere I'd save my self having to re-parse for every request wouldn't I? . . Why don't you try caching the results instead? - Perrin
Re: child-parent memory access / mod_perl / shared mem / inter-proccesscommunication , etc..
Matt already answered most of your questions. Jim Morrison [Mailing-Lists] wrote: And I'm getting some mileage out of experimenting with this anyhow - if it doesn't work for LibXML it looks like it could be very useful for other stuff, and if it ever works bug-free(-ish) I'd like to give something back to all the CPAN-people who've written things I use.. No offense, but you are reinventing the wheel. There are many modules available for sharing cached data. They all use Storable, so none will work on LibXML objects, but they are pretty well-known and mature modules: Cache::Mmap, Cache::Cache (which includes an option to use IPC::Sharelite), IPC::MM, MLDBM::Sync, etc. - Perrin