Diffusion Krita f61672b78fbf

Fix a race condition in the lockfree hash table

Authored by dkazakov on Mar 16 2019, 10:41 AM.

Description

Fix a race condition in the lockfree hash table

We didn't know, but Preshing's hash table has almost full-featured
CAS functionality. It is available via a mutator, which reads the
value and doesn't allow writing back if the source value is has changed.

The actual race condition of the previous implementation happened
on 3+ cores system. While two threads were fighting for putting their
tile to the table, some other (third) thread could take one of their
tiles, initialize it and use for writing. Obviously, this tile could
be pushed out of the table as a result of the fight, so the written
data would just get lost, causing white holes in the image.

Details

Committed
dkazakovMar 17 2019, 4:07 PM
Parents
R37:9b827396e718: Remove a dedicated counter for the amount of objects in the garbage collector
Branches
Unknown
Tags
Unknown