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
Allow to use scala.collection.concurrent.TrieMap
#3149
Allow to use scala.collection.concurrent.TrieMap
#3149
Conversation
private val _aliveThreads = new ConcurrentHashMap[Long, NativeThread]() | ||
private val _aliveThreads = TrieMap.empty[Long, NativeThread] |
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.
Is there still a plan to port ConcurrentHashMap
at a later point? I'd have to read the paper again but I think TrieMap
makes different performance trade-offs than ConcurrentHashMap
to support some special features.
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.
Yes, at some point I wish we port all the collections from JSR-166. The implementation ported from Scala.js is great, but I'm worried that it's not safe enough for usage in a multithreading environment.
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.
The implementation ported from Scala.js is great, but I'm worried that it's not safe enough for usage in a multithreading environment.
Oh, definitely cannot use the current implementation in multi-threading :) we rely a lot on ConcurrentHashMap
in Cats Effect.
scala.collection.parallel
java.util.concurrent.CouncurrentHashMap