Conversation
|
I think that it's fair to do this given the presence of a Rayon implementation also (although, IMHO, we shouldn't be including these implementations in this crate…) but I also think that regardless of what is done, any primitives needed to make this work should be added to For example, at one point I was contemplating offering an API that directly provided access to the |
|
I talked about this in person with @gendx at EuroRust. The main issue with the current implementation is that it returns an iterator of A mid-level API that just exposes buckets like #613 might work for |
fa5e8c8 to
a386031
Compare
|
With Paralight v0.0.10, it's now possible to define parallel iterators where each bucket produces an Some general remarks:
*Internally, the Paralight execution engine will ensure that each bucket index has been passed once and only once to a call to |
…(de)allocate the hash table on other threads.
|
Haven't fully read the code but would like to reiterate my opinion that instead of offering implementations of existing parallel helper traits, we should make all the primitives necessary to implement them available to use by any crate at minimum. Then, ideally, those crates can just provide their own implementations and APIs. In particular, what APIs are needed to accomplish this that you think should be added? |
Practically, "the code is the contract". At the moment, several internal-only APIs on internal-only types:
However, I think it's important to agree on the high-level approach to handle integration between crates before diving too much into the technical details. Fundamentally, there's only a handful of ways to allow this kind of integration. I don't really have a preference as long as integration is technically feasible - ultimately each provider crate decides which approach they want to pursue.
|
|
I think it's also worth pointing out that the main purpose of And, since |
Paralight is a lightweight parallelism library tuned for indexed structures such as slices. Given that the internal representation of hashbrown's hash tables is a slice of buckets (that each optionally contain a value), it's a good fit to integrate with (gendx/paralight#5).
This pull request is here to iterate on the design. As the integration needs access to the raw hash table representation, it's done here in the hashbrown crate (similarly to Rayon's integration).