[webkit-dev] Making WTF::StringImpl and WTF::AtomString thread-safe
darin at apple.com
Wed Dec 9 14:16:55 PST 2020
> On Dec 9, 2020, at 1:02 PM, Geoff Garen via webkit-dev <webkit-dev at lists.webkit.org> wrote:
>> - Make FontCache thread-safe, but do it via introducing a completely
>> separate thread-safe AtomString type and leave the current one as it is
>> (I don't have a good grasp of how difficult this would actually be)
> I had to chuckle at this point because the obvious name for this new thread-safe AtomString class would be AtomicString, the prior name of AtomString.
If we make a separate thread-safe code path, I’m not sure we need to create a variant of AtomString at all.
AtomString optimizes string comparisons (by paying up front every time you construct one with a hash table lookup) and memory use (by sharing the same memory for all equal strings), but there’s no reason we can’t compare two strings without using AtomString. I’m doubting that once we figure out what we’re trying to do that we’ll need AtomString.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev