Skip to content

Commit 4cb1faf

Browse files
author
Tyler Neely
committed
Use unbuffered work queue in the dynamic threadpool to reduce bufferbloat
1 parent d75aae2 commit 4cb1faf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/task/blocking.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ lazy_static! {
3838
.expect("cannot start a thread driving blocking tasks");
3939
}
4040

41-
// We want to bound the work queue to make it more
42-
// suitable as a backpressure mechanism.
43-
let (sender, receiver) = bounded(MAX_THREADS as usize);
41+
// We want to use an unbuffered channel here to help
42+
// us drive our dynamic control. In effect, the
43+
// kernel's scheduler becomes the queue, reducing
44+
// the number of buffers that work must flow through
45+
// before being acted on by a core. This helps keep
46+
// latency snappy in the overall async system by
47+
// reducing bufferbloat.
48+
let (sender, receiver) = bounded(0);
4449
Pool { sender, receiver }
4550
};
4651
}

0 commit comments

Comments
 (0)