Skip to content

Commit

Permalink
io: increase ScheduledIo tick resolution (#6135)
Browse files Browse the repository at this point in the history
While this is no current evidence that increasing the tick resolution is
necessary, since we have available bits, we might as well use them.
  • Loading branch information
carllerche committed Nov 8, 2023
1 parent 30b2eb1 commit 19d96c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tokio/src/runtime/io/scheduled_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ enum State {
//
// | shutdown | driver tick | readiness |
// |----------+-------------+-----------|
// | 1 bit | 8 bits + 16 bits |
// | 1 bit | 15 bits + 16 bits |

const READINESS: bit::Pack = bit::Pack::least_significant(16);

const TICK: bit::Pack = READINESS.then(8);
const TICK: bit::Pack = READINESS.then(15);

const SHUTDOWN: bit::Pack = TICK.then(1);

Expand Down

0 comments on commit 19d96c0

Please sign in to comment.