[prev] [thread] [next] [Date index for 2005/02/16]
--0-2091436785-1108561733=:33946 Content-Type: text/plain; charset=us-ascii I have read sections in W. Richard Stevens' book APUE and my conclusion is that unix does handle sharing of read-only files fine. The problem with sharing files arises only when writing is involved which usually requires atomic operations. Of course, database handlers are totally different kind of beast and is not of concern here. So I think it is safe and reliable to share a read-only file opened in the parent modperl process amongst all modperl processes, at least on the unix systems which concerns me here. Thanks Richard Gedanken <gedanken@xx.xxx> wrote: 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 --------------------------------- Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term' --0-2091436785-1108561733=:33946 Content-Type: text/html; charset=us-ascii <DIV>I have read sections in W. Richard Stevens' book APUE and my conclusion is that unix does </DIV> <DIV>handle sharing of read-only files fine. The problem with sharing files arises only when writing is involved which usually requires atomic operations. Of course, database handlers are totally different kind of beast and is not of concern here.</DIV> <DIV> </DIV> <DIV>So I think it is safe and reliable to share a read-only file opened in the parent modperl process amongst all modperl processes, at least on the unix systems which concerns me here.</DIV> <DIV> </DIV> <DIV>Thanks</DIV> <DIV> </DIV> <DIV>Richard</DIV> <DIV><BR><BR><B><I>Gedanken <gedanken@xx.xxx></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Tue, 15 Feb 2005, Richard Chen wrote:<BR><BR>Im a big fan of reading read-only data files, config files, etc at server <BR>start up in startup.pl and sharing between children. There could easily <BR>be problems with my approach and i welcome the criticism =)<BR><BR>The only time I have been burned with parent-child sharing is with <BR>database handles in forked processes. you have to jump through hoops with <BR>mysql/dbi or else all kinds of corruption occurs when the child uses the <BR>handle created in the parent.<BR><BR>mfp<BR><BR><BR>Hi,<BR><BR>I recall that in general it is not a good idea to open<BR>a file in the parent modperl process and then share it<BR>among the child modperl processes. One should open the<BR>file separately in each of the child processes. But what<BR>if the file is used just for read-only access? Is it still<BR>necessary to open the file separately in the child<BR>processes? It seems to be more efficient to share if it<BR>can be done reliably. <BR><BR>The practical-modperl book gives an example showing<BR>how to open a read-only dbm file from child init handler<BR>in each of the child process. But there is no rational given.<BR><BR>For the few tests I have done using MLDBM, opening the<BR>file in the parent process and then sharing that among<BR>the child processes seems to work fine. But I would like to know<BR>if there are any potential problems associated with this practice.<BR><BR>Thanks for any info.<BR><BR>Richard Chen<BR><BR><BR><BR>---------------------------------<BR>Do you Yahoo!?<BR>Yahoo! Search presents - Jib Jab's 'Second Term'<BR><BR>-- <BR>gedanken<BR></BLOCKQUOTE><p> <hr size=1>Do you Yahoo!?<br> Yahoo! Search presents - <a href="http://us.rd.yahoo.com/evt=30648/*http://movies.yahoo.com/movies/feature/jibjabinaugural.html">Jib Jab's 'Second Term'</a> --0-2091436785-1108561733=:33946--
![]() |
Is it safe to share a read-only dbm file opened in parent modperl?
|
![]() |
![]() |
Re: Is it safe to share a read-only dbm file opened in parent modperl?
|
![]() |
![]() |
![]() |
Re: Is it safe to share a read-only dbm file opened in parent modperl?
|
Generated at 11:21 on 20 Feb 2005 by mariachi v0.52