Skip to content

[Feature Request] Have the function passed to defer receive the current epoch count #459

Open
@markww

Description

@markww

I'm currently working on a project where I have custom allocators that want to perform epoch garbage collection, but with special, nonstandard allocation/deallocation behavior. To accomplish this, I intend to use crossbeam-epoch's Guard::defer method to indicate to these custom allocators when thread-time (here meaning intervals after which all threads have released Guards) advances, allowing them to perform a local epoch garbage collection.

Unfortunately, the weak guarantees of defer mean that I will almost certainly not get called back right when all threads get unpinned in some circumstances, causing my allocators to lose time. This would be a non-issue if the function passed to defer received the current epoch count, as the custom allocators could see how much time they lost and use this information to potentially clean up multiple epochs-worth of stale lists at once. Would it be possible to add this feature? Or, is it already possible and I'm just not seeing a combo of calls that would make it happen?

Thanks for this project, the crossbeam-epoch system is saving me a lot of work and confusion!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions