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

Distinct output capabilities #187

Merged
merged 3 commits into from Sep 6, 2018

Conversation

Projects
None yet
1 participant
@frankmcsherry
Owner

frankmcsherry commented Sep 5, 2018

This PR adds support for distinguished output capabilities, where each Capability<T> is bound to a specific operator output. A CapabilityRef<T> is able to be downgraded or retained for specific outputs; for compatibility the methods without the output argument use the first output. The CapabilityTrait now provides a method that validates the capability for use with an output, which performs Rc::ptr_eq on the buffers they would be updating (and in the case of CapabilityRef check each possible buffer, corresponding to the outputs).

This adds a bit of ergonomic complexity for folks writing custom operators with multiple outputs, but it is important for anyone who wants to distinguish their output capabilities to enable concurrency that would otherwise be falsely prevented.

This PR does not validate the compatibility of the capabilities production according to the operator summary, so a user can still create a capability from an input for an output that they have claimed cannot be reached internally. This would be great to add, but might increase the per-capability reasoning substantially. Future work!

Fixes #186

@frankmcsherry

This comment has been minimized.

Show comment
Hide comment
@frankmcsherry

frankmcsherry Sep 6, 2018

Owner

Let's land this! It also appears to fix #134. Once @utaal is back, we can review for non-obvious issues.

Owner

frankmcsherry commented Sep 6, 2018

Let's land this! It also appears to fix #134. Once @utaal is back, we can review for non-obvious issues.

@frankmcsherry frankmcsherry merged commit a78bc26 into master Sep 6, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@frankmcsherry frankmcsherry deleted the multi_capabilities branch Sep 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment