-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read write lock fully reentrant #1562
Conversation
janbar
commented
Feb 13, 2024
- It is fully re-entrant: read/write/read , and so it allows upgrading of reader to writer
- No more collisions when testing recursive S
- At least 5% faster than previous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just curious if usage of std::list
would not be enough...?
Hehe, using std::list you will get 5 times slower. You are right, std::list use a chain internally, but we haven't access directly to the linked nodes, previous or next: We have to use the iterator. Also it allocates a new pointer for each added element, unless we implement a dedicated allocator ... much work for a so simple thing, and not really efficient. |
0fa034d
to
6601810
Compare
Please wait before merge it. I am running some tests. Edit: using not tiled rendering, a reader thread still owns the lock in move. This behavior also existed before this commit, so there is no regression. |
- It is fully re-entrant: read/write/read - No more collisions when testing recursive S - At least 5% faster than previous - Uses TTAS for spin lock, instead TAS
6601810
to
804a1e6
Compare
I updated the spin lock to implement TTAS instead TAS. The performance is better again, and I cannot do better. @Framstag , you can merge the PR as you wish. |
🎉 This issue has been resolved in |