httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert S. Thau" <>
Subject "Strcasecmp problem"
Date Sat, 03 Aug 1996 00:00:01 GMT
  The problem is within the init_mime routine and the problem is 

  static table *hash_buckets[ MIME_HASHSIZE];

My email seems to be getting lost in the ether again, so I'll try sending
from hyperreal (summarizing stuff previously sent), and see if it gets

To summarize --- init_mime is the *only* function which writes that array.
BTW, it's pretty weird to say that a data structure is "not thread-safe";
if multiple threads are trying to write that array at the same time, then
*that* wouldn't be thread-safe --- but that's the code's fault, not the

Furthermore, init_mime is only called at server startup or restart, when
no one else is even looking at the array in question.  (It is only referenced
in mod_mime --- and there only in the functions init_mime and find_ct.  The
latter should only be called when requests are being served --- and that
certainly should not be happening before the config files have been 
completely read!).

So, the only possible conflict is if two threads are calling init_mime
at the same time.  But that simply shouldn't be happening --- it certainly
doesn't happen in stock Apache.  Even if you have multithreaded server
*startup*, for some unaccountable reason, why are you initializing the
*same module* more than once?

in short, I'm not completely persuaded of your diagnosis; even if it
is correct, I think it is better to figure out why init_mime is being
called by multiple threads, and stop it, than to change that particular


View raw message