Skip to content

Run both local end multi-threaded executors #4

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

oblique
Copy link

@oblique oblique commented Jul 25, 2020

With this someone can run both Executor and LocalExecutor. Here's an example:

let ex = Executor::new();
let local_ex = LocalExecutor::new();

local_ex.enter(|| ex.run(async { }));

// or

ex.enter(|| local_ex.run(async { }));

LOCAL_EX.with(|local_ex| Rc::clone(&local_ex.parker))
} else {
Rc::new(parking::Parker::new())
};
Copy link
Author

@oblique oblique Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this acceptable?
Another way is refactoring multitask and introducing LocalTicker.

@Keruspe
Copy link
Contributor

Keruspe commented Jul 25, 2020

See also #3 for a much simpler (imo) alternative which works fine to do just that with each thread doing some ex.enter(|| local_ex.run(fut))

@ghost
Copy link

ghost commented Aug 29, 2020

Closing for the same reason as #6

@ghost ghost closed this Aug 29, 2020
This pull request was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants