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

Add interfaces for activating across thread boundaries #287

Merged
merged 1 commit into from Aug 22, 2019

Conversation

@benesch
Copy link
Contributor

commented Aug 21, 2019

Add interfaces that make it easy to send activations across thread
boundaries.

The approach is to give Activations an MPSC channel which it checks
for activation requests on every call to advance. Other threads can
acquire a handle to the send side of this object via SyncActivations
or SyncActivator, which are careful to also call unpark on the
associated worker thread for easy interop with Worker.step_or_park.

@frankmcsherry I created more interfaces than we actually need just to see how it feels–and I think it feels pretty good! My WIP @MaterializeInc branch only uses SyncActivator, so we could potentially inline the SyncActivations struct, but the symmetry with Activator and Activations seemed like it might be nice. We could also expose the underlying SendError directly, instead of replacing it with a SyncActivationError.

@benesch benesch force-pushed the benesch:sync-activate branch from 5d58050 to a8cfadc Aug 22, 2019

Add interfaces for activating across thread boundaries
Add interfaces that make it easy to send activations across thread
boundaries.

The approach is to give `Activations` an MPSC channel which it checks
for activation requests on every call to `advance`. Other threads can
acquire a handle to the send side of this object via `SyncActivations`
or `SyncActivator`, which are careful to also call unpark on the
associated worker thread for easy interop with `Worker.step_or_park`.
@frankmcsherry

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

Looks nice! Is it ready to go from your point of view?

@benesch

This comment has been minimized.

Copy link
Contributor Author

commented Aug 22, 2019

Yessir!

@frankmcsherry frankmcsherry merged commit f2b0cc7 into TimelyDataflow:master Aug 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.