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

(unnecessary?) sync locking when checking if Native is loaded causes unneeded slowdown #80

Open
noamBarkai opened this issue Feb 21, 2016 · 5 comments

Comments

@noamBarkai
Copy link

When using this library in a highly concurrent setting - vis. Apache Spark - I'm seeing a lot of contention around this synchronisation block, specifically when called from here
It seems the synchronisation is somewhat redundant and that it can safely be removed, assuming the boolean member loaded is modified to volatile, no?
I can offer a PR if you feel like wise.

@odaira
Copy link
Member

odaira commented Sep 17, 2018

Yes, I think changing loaded to volatile will work. If you still see the contention problem and if you submit a PR, I'll take a look at it.

@noamBarkai
Copy link
Author

@odaira - it's been a while since this issue was opened... :)
I'm not sure if this problem still persists, but regardless I can open a PR, no problem, I don't think it's harmful.

@noamBarkai
Copy link
Author

#126

@odaira
Copy link
Member

odaira commented Sep 25, 2018

Thanks much for your contribution. Because I am about to release a new version, I'll review this after that.

@JoshRosen
Copy link
Contributor

In Spark, apache/spark#24905 may partially mitigate this by significantly reducing the number of calls to fastestInstance().

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