Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@sdmaclea
Copy link

@sdmaclea sdmaclea commented Aug 25, 2017

Keep hot/cold data on separate cache lines
Fix errors in exponential backoff
Make m_WriterWaiting Volatile and only use MemoryBarriers on write
Simplify code

Keep hot/cold data on separate cache lines
Fix errors in exponential backoff
Make m_WriterWaiting Volatile and only use MemoryBarriers on write
Simplfy code
@sdmaclea
Copy link
Author

sdmaclea commented Aug 25, 2017

@kouvel @vancem PTAL . I just realized this was not the same lock you were optimizing. The ideas may still overlap....

@sdmaclea
Copy link
Author

@jkotas @janvorli This was a patch I drafted when this lock was being hit hard by the plaintext test on arm64. At the time it made a significant improvement, but another patch made it unnecessary for plaintext optimization. PTAL it may still be useful in contended cases

@sdmaclea
Copy link
Author

It looks like this is failing lots of tests. If you want the optimization, I'll clean it up and make the tests pass.

@sdmaclea
Copy link
Author

The failure look to be related to changes in object size. There are some constants which will need to be updated because The size of SimpleRWLock has changed or perhaps the offset of some of its member variables.

@jkotas
Copy link
Member

jkotas commented Sep 6, 2017

If this change is not improving anything meaningful, I would not bother with it.

For general purpose unmanaged locks like this one , I think we should be rather going towards using the OS provided ones (pthread_rwlock_t on Unix or SRWLock on Windows).

@sdmaclea
Copy link
Author

sdmaclea commented Sep 6, 2017

@jkotas Thanks

Closing till this appears in a profile.

@sdmaclea sdmaclea closed this Sep 6, 2017
@sdmaclea sdmaclea deleted the PR-SimpleRWLock branch December 4, 2017 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants