Skip to content

Conversation

frankmcsherry
Copy link
Member

This PR changes the closure type used for data exchange from Fn to FnMut, allowing it to own its own mutable state and preventing it from being called concurrently.

The motivation is that some more sophisticated exchange functions might take e.g. a Vec<D> and pick out a subset of elements, and hash the result. This is easiest when the closure owns its own Vec<D> that can be populated (or even a Vec<&D>, though lifetimes probably prevent that).

@frankmcsherry
Copy link
Member Author

Apparently it also includes some changes to ParkEvent...

@frankmcsherry
Copy link
Member Author

The PR also raises the question of whether more functions should be FnMut rather than Fn. For example, the functions for map and filter are Fn, whereas those for inspect are FnMut.

@frankmcsherry frankmcsherry merged commit ba22fe3 into master May 27, 2019
@frankmcsherry frankmcsherry deleted the mutable_exchange branch May 27, 2019 14:16
@github-actions github-actions bot mentioned this pull request Oct 29, 2024
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

Successfully merging this pull request may close these issues.

1 participant