hawkw / sharded-slab

a lock-free concurrent slab (experimental)
MIT License
273 stars 19 forks source link

Draining iterator #78

Open jplatte opened 1 year ago

jplatte commented 1 year ago

I'm not very knowledgeable about lock-free data structures; would it be possible to provide a draining iterator that yields all items that exist at the time it is constructed?

hawkw commented 1 year ago

It would require exclusive mutable access to the slab, similar to the existing Slab::unique_iter method. But, we could potentially provide something like that.