On Mon, Sep 10, 2001 at 10:31:48AM +0200, Arthur Bergman wrote:
>
> > > How does Apache deal with this?
> >
> > By carefully repeating "Don't Do That" as they code the httpd ;-).
>
> There are good reasons for this :-)
:-)
> I would suspect linux has a process level chdir, not sure thou.
Just checked, pthread_create() causes all threads to share the cwd and
umask. By using __clone() directly, they could be set as unshared, I
think, by passing CLONE_FS.
I guess the bottom line it: Perl seems to be headed towards an emulation
of multiprocessing (unshared everything by default); how far should it
go in that direction? The Win32 approach has been to go as far as
possible to emulate fork(), and I think that that's a good approach,
since it will lead to least surprises among non-threads programmers.
The downside is increases complexity and a corresponding performance hit
(though I think it will usually be minor).
I think that for mod_perl backcompat purposes the more the merrier, so
that lots of existing modules don't need to be ported to MT-safety. But
for performance-seekers, that may not be the ideal. Of course "for
them, there's C" might be an acceptable answer, I dunno.
Things like umask, %ENV, $SIG{__DIE__}, $SIG{__WARN__}, cwd, open files,
etc. can be copied to get really close to the "ideal", things like euid,
uid, etc., are more difficult to play pretend with.
- Barrie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]