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

Allow to use scala.collection.concurrent.TrieMap #3149

Conversation

WojciechMazur
Copy link
Contributor

  • Implements java dependencies and adapts TrieMap implementation to use Intrinsic based atomic field updaters
  • Removed to longer required Scala 2 sources filtering for scala.collection.parallel
  • Updated ignored lists of Scala2 partest junit tests to test TrieMap and other concurrent types
  • Use TrieMap instead of not concurrent aware implementation of java.util.concurrent.CouncurrentHashMap

private val _aliveThreads = new ConcurrentHashMap[Long, NativeThread]()
private val _aliveThreads = TrieMap.empty[Long, NativeThread]
Copy link
Member

@armanbilge armanbilge Feb 8, 2023

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants