Perrin Harkins wrote:
On Tue, 2003-07-15 at 14:27, Jez Hancock wrote:

On Tue, Jul 15, 2003 at 01:32:11PM +0300, Stas Bekman wrote:

Take a look at:
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler
a similar code will work for mp1 if you don't use 2.0.

Much obliged, that does look to be something I could use. Reminds me I need to be locking the logfile as well ;)


Actually, if you are just printing one short line I think you'll be fine
without locking on unix systems.  See the FAQ:
http://www.perldoc.com/perl5.8.0/pod/perlfaq5.html#All-I-want-to-do-is-append-a-small-amount-of-text-to-the-end-of-a-file.--Do-I-still-have-to-use-locking-

Is this still correct in the threaded environment where the filehandle is shared across several threads? The writes are atomic 4k or so, indeed, but what happens if two threads write to the same filehandle at the same time on the SMP machine? Won't things get messed up? I haven't checked, perhaps perlio already provides an internal locking. Arthur would be a good person to ask.




__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to