|
|
|
|
|
by dathinab
1609 days ago
|
|
The problem is it requires you to write your code in a way which now _only_ will work with tokio. Which isn't an option for a lot of libraries. While the rest of the rust eco-system is increasingly moving to have increasingly more parts runtime independent... Furthermore I think `maybe_yield` wouldn't be quite the right solution. The problem is that tokios magic works based on the assumption that a single task (future scheduled by the runtime) represents a single logical strang of exexution. (Which isn't guaranteed in rust.) So I think a better tokio specific solution would be to teach tokio about the multiplexing effect in some way. For example you could have some way which snapshots the budged when reaching the multiplexer, and reset the budget to the snapshot before every multiplexed feature is called. With this each logical strange of execution would have it's "own" budget (more or less). |
|