httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Robert S. Thau)
Subject Re: Strcasecmp problems
Date Fri, 02 Aug 1996 23:20:57 GMT
  static table *hash_buckets[ MIME_HASHSIZE];

  This is not threadsafe.

Ummm... that's a data declaration.  It can't not be threadsafe.  If
multiple threads are trying to write the array it declares at the same
time, well, *that's* not threadsafe, but unless you've done something
very ill-advised to mod_mime.c or to the way server startup is managed,
that simply shouldn't be happening.  In detail:

That array (and the structures which its elements point to) are only
written by the function init_mime, which is called once and once only
per server startup or restart.  It is therefore written only by the
thread which is reading the config files, which means that there
shouldn't be any writer-vs.-writer conflicts.  It is only *read* by
threads which are serving requests --- but none of that should be
happening until the config files have been read in completely, for
obvious reasons; this eliminates the potential for writer-vs-reader
conflicts.  In fact, at the time config files are read, I'm not sure I
see any point to having multiple threads around at all.


View raw message