Closed bovee closed 2 years ago
Redid this quite a bit in 793c7266b9eae0505af7d5380967aed93a99dc12 to use a BufferChunk
object that gets passed in and out and I think it's a bit better. You still need to wrap state
in a Mutex
and return the BufferChunk
from the rayon
scope, but it seems like it works (although I've only tested it on toy examples where the multithreading overhead totally kills any perf gains).
As a note, I'm considering the current API as a beta and I marked all the documentation for it as hidden until it gets trialed a little more (preferably by someone with an actual use case!)
I tried writing the following documentation on how to pass records off to e.g. a thread poll, but it doesn't work.
It threw the following errors:
The ergonomics here are still pretty bad (e.g. it would be nice to write
rb.next_no_refill
?) but that might be because I haven't written any crossbeam/rayon/etc code lately.