Skip to content

Conversation

@kuszmaul
Copy link

This PR provides SimpleFIFOLock, effectively another implementation of FIFOLock.

It's about 1/3 less code, and is simpler: It just uses simple condition-variable programming with no protocol on atomic variables.

On Xeon(R) Platinum 8488C for the following benchmark:

@btime begin lock($f); unlock($f); end

I see the following performance:

13ns for SpinLock
17ns for ReentrantLock
33ns for FIFOLock
35ns for SimpleFIFOLock

So it is a little slower than FIFOLock, but maybe the extra simplicity makes it preferable.

@kuszmaul
Copy link
Author

I'm not proposing to actually merge this PR. For one thing, it would seem strange to have two implementations of the same thing (FIFOLock and SimpleFIFOLock).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant