Feature: retire without reclaim
elahn opened this issue · comments
Elahn Ientile commented
Threads with tight latency or timing requirements (e.g. soft real-time, audio, high fps GUI) can't afford to reclaim when retiring objects.
There are two ways this could be exposed on HazPtrObject
:
unsafe fn retire_no_reclaim(this: *mut Self, deleter: &'static dyn Deleter) -> usize
unsafe fn retire(this: *mut Self, allow_reclaim: bool, deleter: &'static dyn Deleter) -> usize
I mildly prefer (2). I'm happy to send a PR or leave for discussion on the next stream.
Jon Gjengset commented
That's a good idea — please do send a PR! I prefer a separate method so that we can more easily document (by name and docs) that this will accumulate garbage over time, and what users should do when they do want to reclaim.
Some other ideas for names
retire_lazy
retire_later
mark_retired
retire_only