Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: retire without reclaim #18

Open
elahn opened this issue Jan 20, 2022 · 1 comment
Open

Feature: retire without reclaim #18

elahn opened this issue Jan 20, 2022 · 1 comment

Comments

@elahn
Copy link

elahn commented Jan 20, 2022

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:

  1. unsafe fn retire_no_reclaim(this: *mut Self, deleter: &'static dyn Deleter) -> usize
  2. 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.

@jonhoo
Copy link
Owner

jonhoo commented Jan 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants