ruby / set

This library provides the Set class, which deals with a collection of unordered values with no duplicates.
BSD 2-Clause "Simplified" License
23 stars 13 forks source link

JRuby support #21

Open headius opened 2 years ago

headius commented 2 years ago

For performance and Java integration reasons, JRuby provides a native implementation of the set library. We would like to be able to use the gem, and our users will eventually add the gem to their bundles, so we need an answer. This will probably mean importing our extension into the gem, or we push a separate gem with our extension and load it from the pure-Ruby gem.

I will handle making the changes necessary.

knu commented 11 months ago

It depends on how large part is written in Java, but I think it should be better maintained separately and there could be some tricks in loading on the pure-Ruby gem part and such a change request is welcome.

headius commented 1 month ago

We could have a shared implementation entirely in Ruby but there are a number of issues with the current implementation:

Given the importance of Set for concurrent code, JRuby can't use the existing set.rb... and realistically, CRuby should not be using it either if there's any concurrent operations happening. I believe Ruby needs to have a concurrency-safe, efficient implementation of Set going forward.