From: Godmar Back (gback@cs.utah.edu)
Date: Wed Jan 06 1999 - 16:22:40 EST
>
> 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.
The point is that it may be possible that you're blocked
in a malloc while the collector tries to remove entries
(when destroying strings).
If you're holding the hashtable lock while you're blocked in malloc
waiting for the collector to do its thing, the system will deadlock.
>
> As a separate question, why aren't we using HASH_SYNCHRONIZE?
You removed it.
> 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.
I remember you sending out mail that you found it better to
move it out cause you had to lock other things anyway.
Also, note the changes I made to string.c where I lock
less aggressively than you did.
>
> So my vote is to get rid of all the HASH_* flags since none of
> them are needed. This makes point #1 moot anyway.
>
HASH_REENTRANT is needed unless you want to make it the default,
which actually wouldn't be a bad thing and cheap too.
- Godmar
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:30 EDT