On Tue, 15 Feb 2005, Richard Chen wrote: Im a big fan of reading read-only data files, config files, etc at server start up in startup.pl and sharing between children. There could easily be problems with my approach and i welcome the criticism =)
The only time I have been burned with parent-child sharing is with database handles in forked processes. you have to jump through hoops with mysql/dbi or else all kinds of corruption occurs when the child uses the handle created in the parent. mfp Hi, I recall that in general it is not a good idea to open a file in the parent modperl process and then share it among the child modperl processes. One should open the file separately in each of the child processes. But what if the file is used just for read-only access? Is it still necessary to open the file separately in the child processes? It seems to be more efficient to share if it can be done reliably. The practical-modperl book gives an example showing how to open a read-only dbm file from child init handler in each of the child process. But there is no rational given. For the few tests I have done using MLDBM, opening the file in the parent process and then sharing that among the child processes seems to work fine. But I would like to know if there are any potential problems associated with this practice. Thanks for any info. Richard Chen --------------------------------- Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term' -- gedanken