3 ms·
Sorry, you're right - I missed that part. I had a few assumptions in mind that obviously break down with a bit of reasoning. The algorithm from the paper you p
by ameixaseca 5y ago
Sorry, you're right - I missed that part. I had a few assumptions in mind that obviously break down with a bit of reasoning.
The algorithm from the paper you posted in another comment indeed looks more complicated than it needs to be and prone to bad performance.
Judging by the design, it appears they were trying to avoid the local thread to touch the shared counter in any circumstance on the hot path, but I wonder if it would not be much simpler for the owner thread to just check a flag set by the non-owner thread and perform the unbiasing/freeing right away without going through all the queuing mechanism.