Skip to content

Commit 15e54c1

Browse files
committed
chore:理下思路
1 parent 8494efd commit 15e54c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

multi_event_loops_options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ func WithEventLoopReadBufferSize(size int) func(*Options) {
9393
}
9494

9595
// 设置流量背压机制,当连接的写缓冲区满了,会暂停读取,直到写缓冲区有空闲空间
96+
// 目前垂直(et)触发模式下会有问题
97+
// 如果要在et模式实现流量背压机制,就需要自己管理fd的可读/可写状态, 因为内核只会在 不可读->可读 的时候触发事件, 可读但是未读取的时候不会触发事件
98+
// 可写同理, 可写->不可写 的时候触发事件, 不可写但是未写入的时候不会触发事件
9699
func WithFlowBackPressure(enable bool) func(*Options) {
97100
return func(o *Options) {
98101
o.flowBackPressure = enable
99102
}
100103
}
101104

102105
// 设置流量背压机制,当连接的写缓冲区满了,会移除读事件,直到写缓冲区有空闲空间
103-
// 第二种背压机制会比第一种背压机制更高效, 7945hx cpu上,第二种是3.4GB/s的读写 第一种是3.0GB/s的读写
106+
// 第二种背压机制会比第一种背压机制更高效(lt模式下,et没有实现), 7945hx cpu上,第二种是3.4GB/s的读写 第一种是3.0GB/s的读写
104107
func WithFlowBackPressureRemoveRead(enable bool) func(*Options) {
105108
return func(o *Options) {
106109
o.flowBackPressureRemoveRead = enable

0 commit comments

Comments
 (0)