logoalt Hacker News

Concurrent Hash Table Designs

78 pointsby signa11last Saturday at 2:36 PM11 commentsview on HN

Comments

mrkeenlast Tuesday at 7:02 PM

  public V get(Object key) { synchronized (mutex) { ... } }
  public V put(K key, V value) { synchronized (mutex) { ... } }
  public V remove(Object key) { synchronized (mutex) { ... } }
> From a correctness standpoint, this strategy is almost trivial to reason about.

It is indeed trivial to reason about. This design invites users to stumble into the race condition between get and set.

show 3 replies
nickmonadlast Tuesday at 4:21 PM

Would love to read this, although I'm seeing some pretty horrific code formatting issues in both Firefox and Chrome.

show 3 replies
leitasatyesterday at 1:05 AM

> 2025 > Java

really