From: Archie Cobbs (archie@whistle.com)
Date: Wed Jan 06 1999 - 16:12:47 EST
Godmar Back writes:
> note how I changed hashtab.c & friends.
>
> The HASH_REENTRANT flag is kind of gross; but I didn't know how else
> to avoid deadlocking there.
>
> Basically, neither HASH_ADDREFS nor HASH_SYNCHRONIZED are used anymore.
> (We had actually forgotten to remove the ADDREF for the utf8consts)
> Since both flags incur a run-time costs, what would you think about
> removing them from hashtab.c?
That's fine with me. I think hashtab.c should be as fast & minimal
as possible while still doing it's job (which is to serve both
String interning and utf8const interning).
Two things I don't understand however..
I don't understand why you added HASH_REENTRANT. It seems like
if you use HASH_SYNCHRONIZE, then you don't need HASH_REENTRANT,
as the check for NEED_RESIZE() and the call to hashAdd() are both
done while the mutex is continuously locked.
As a separate question, why aren't we using HASH_SYNCHRONIZE?
This is presumably because the hashtable is not re-entrant...
which is true, as utf8const.c and string.c both have their
own 'bigger' locks.
So my vote is to get rid of all the HASH_* flags since none of
them are needed. This makes point #1 moot anyway.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:30 EDT