Skip to content
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

HTM or fine-grained locking #75

Open
danghvu opened this issue Apr 30, 2017 · 3 comments
Open

HTM or fine-grained locking #75

danghvu opened this issue Apr 30, 2017 · 3 comments

Comments

@danghvu
Copy link

danghvu commented Apr 30, 2017

In the original paper: https://www.cs.princeton.edu/~mfreed/docs/cuckoo-eurosys14.pdf

It mentions there are two modes: HTM or fine-grained locking. If I'm using the default configuration, which is actually being used ? I run it on a Intel machine (x86_64, a Xeon server), does that mean it enables HTM by default ?

@manugoyal
Copy link
Contributor

Hey @danghvu! The paper does indeed explore both HTM and fine-grained locking, but for this implementation, we decided to stick with just fine-grained locking. The implementation is intended to work well for all kinds of C++ types across a variety of machines, so we settled on fine-grained locking, which allows safe memory management for all C++ types.

It would definitely be possible to support HTM for intel machines for specific key-value pairs (integer-integer, for example), but we haven't gotten around to that yet.

@ldalessa
Copy link

ldalessa commented May 1, 2017

I was wondering if there's any easy way to test HLE on the current fine-grained locking version. Is there any obvious way to get the spinlock to play along? I presume it would have something to do with the std::atomic_flag test-and-set.

@manugoyal
Copy link
Contributor

It might be possible. Found this blog post on intel's website, where someone implements an elided mutex with HLE: https://software.intel.com/en-us/blogs/2013/07/25/fun-with-intel-transactional-synchronization-extensions.

So presumably, yes, spinlock can be modified to use HLE and still support the lock and unlock functions. Haven't tried it out myself, though.

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

No branches or pull requests

3 participants