hash tables & multi-threading

Archie Cobbs archie at whistle.com
Fri Jan 15 19:29:18 PST 1999


Alex Nicolaou writes:
> Secondly, it seems to me that the hash table entry points aren't
> threadsafe, and
> each place where a hash table is used a static mutex is allocated to
> control 
> access to that hash table. Why not put the mutex in the hash table
> structure itself, and provide entry points hashLock() and hashUnlock()
> that need to be called before calling into the other entry points? Or
> perhaps make the underlying code threadsafe?

Originally it was done as you suggest, with "bigger" locks,
but Godmar made them smaller. You'll have to ask him for
a proof why it's still thread safe, as I haven't picked
through his changes yet.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list