Perrin Harkins wrote:
On Tue, 2003-07-15 at 16:11, Stas Bekman wrote:

Is this still correct in the threaded environment where the filehandle is shared across several threads?


Why would the filehandle be shared?  Wouldn't you open a new handle in
each thread?

Because it's shared on the OS level. You open a new perl IO handle in each thread, but I think that they all use the same filedescriptor underneath. I think Arthur was mentioning that at his ithreads talk. Need to run some tests to confirm that.


I expect this would be fine, since the behavior is enforced by the
system library rather than by Perl.  You can always use flock if you're
feeling paranoid about it though.

Are you sure? Won't flock maintain a process-wide flag? Unless there is a special threads-aware implementation that does it right.


This is of course just rambling based on known issuws with all the other process-wide variables like cwd, chroot, environ, etc.



__________________________________________________________________
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