[PATCH] D27155: Merge strings using concurrent hash map (3rd try!)

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 20:37:27 PST 2016


Rui Ueyama via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:

> +
> +      // The current bucket contains some string. Its size might not be
> +      // written by other thread yet, so try loading until it becomes
> +      // observable.
> +      const char *OldKey = Bucket.Key.load();
> +      uint64_t OldVal;
> +      while ((OldVal = Bucket.Val.load()) == 0)
> +        ;


This fails if someone inserts an empty string, no?

Being non-deterministic is a big issue. How much would the performance
degrade if you sorted the table?

Cheers,
Rafael


More information about the llvm-commits mailing list