Closed
Description
Hello
When browsing code around, I've came to wonder about one thing. What would go wrong, if I created a trivial „recursive“ executor by running the task directly inside the schedule closure? Eg:
let (task, handle) = async_task::spawn(future, Task::run, ());
task.run();
So far, this has crossed my mind:
- It'll probably make it run in whatever thread wakes the future (so the thread that polls timers or epoll or whatever), which might not be happy about the added latencies.
- Can the task get called recursively somehow?
- If so, doesn't that create two mut references to the future?
Or, are there any other problems or restrictions what the schedule closure can do?
Metadata
Metadata
Assignees
Labels
No labels