httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Schumann <sas...@schumann.cx>
Subject Re: [?PATCH?] using getpwnam_r in mod_userdir
Date Sat, 11 Nov 2000 00:44:24 GMT
> This whole problem is bogus.  I am very much leaning towards saying that
> since this problem is really unsolvable we should just not support thread
> Apache on these platforms.

    Well, I think we can refine the 'throwing-out-the-child-with-
    the-bathwater-approach'.

> Before anybody tells me we can work around these issues, remember that we
> really have no idea what functions are called internal to the C Run-time,
> so we can't fix these problems 100%.  If a platform doesn't provide a
> known thread-safe implementation, then we really can't hack a valid
> long-term solution.  Imagine the case where both getpwnam and getpwent
> make a call to the same function within the C run-time, and we have two
> modules one that calls getpwent and one that calls getpwnam.  We can't
> protect ourselves from threading issues in that case.  It isn't possible.

    That's a problem indeed.

    Remember that we need to have a wrapper anyway for all of
    those _r functions, because the source code will use _r
    functions even in non-threaded mode. (Unless you choose to
    duplicate code for both modes all over the place.)

    I think we should use a single lock for protecting one
    sub-system. We need to define `sub-system' here. FreeBSD will
    need one lock for getpw functions.

    If a certain platform shows signs of hidden inter-function
    dependencies, I'd be in favor of disabling threading on that
    platform. Experience will tell.

    - Sascha


Mime
View raw message