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

Consider Load-Link Store-Conditional abstraction #1

Open
jzabroski opened this issue Mar 18, 2019 · 3 comments
Open

Consider Load-Link Store-Conditional abstraction #1

jzabroski opened this issue Mar 18, 2019 · 3 comments

Comments

@jzabroski
Copy link

jzabroski commented Mar 18, 2019

Rather than locking your type buffer, consider implementing a Load-Link Store-Conditional abstraction. Rather than worry about the state, just retry the whole chain if Store-Conditional fails.

The main benefit I see is it would potentially uncomplicate the code a lot. I'm not sure if it would be any faster, but it's conceivable it would.

@jzabroski
Copy link
Author

If you're interested, I know my friend Sandro Magi has written a LLSC abstraction in his Sasa NuGet package in the Sasa.Concurrency namespace. That would probably lower the bar for prototyping getting rid of the lock requirements.

@gafter
Copy link
Owner

gafter commented Jul 2, 2019

@jzabroski Because the hash table has to be expended by doubling the size of the array and rebucketing the data, I don't think that technique works well. In any case, we only lock on writes, not on reads.

@gafter
Copy link
Owner

gafter commented Jul 2, 2019

I should also mention that the implementation is intended to be suitable for use in the core library. Taking advantage of a higher-level library would undermine that.

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

2 participants