Skip to content

Commit

Permalink
chore: add a few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Mar 30, 2024
1 parent eef3950 commit efb0d94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/netpoll/epoll_default_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ func (p *Poller) Trigger(priority queue.EventPriority, fn queue.TaskFunc, arg in
if priority > queue.HighPriority && p.urgentAsyncTaskQueue.Length() >= p.highPriorityEventsThreshold {
p.asyncTaskQueue.Enqueue(task)
} else {
// There might be some low-priority tasks overflowing into urgentAsyncTaskQueue in a flash,
// but that's tolerable because it ought to be a rare case.
p.urgentAsyncTaskQueue.Enqueue(task)
}
if atomic.CompareAndSwapInt32(&p.wakeupCall, 0, 1) {
Expand Down
2 changes: 2 additions & 0 deletions internal/netpoll/epoll_optimized_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ func (p *Poller) Trigger(priority queue.EventPriority, fn queue.TaskFunc, arg in
if priority > queue.HighPriority && p.urgentAsyncTaskQueue.Length() >= p.highPriorityEventsThreshold {
p.asyncTaskQueue.Enqueue(task)
} else {
// There might be some low-priority tasks overflowing into urgentAsyncTaskQueue in a flash,
// but that's tolerable because it ought to be a rare case.
p.urgentAsyncTaskQueue.Enqueue(task)
}
if atomic.CompareAndSwapInt32(&p.wakeupCall, 0, 1) {
Expand Down
2 changes: 2 additions & 0 deletions internal/netpoll/kqueue_default_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func (p *Poller) Trigger(priority queue.EventPriority, fn queue.TaskFunc, arg in
if priority > queue.HighPriority && p.urgentAsyncTaskQueue.Length() >= p.highPriorityEventsThreshold {
p.asyncTaskQueue.Enqueue(task)
} else {
// There might be some low-priority tasks overflowing into urgentAsyncTaskQueue in a flash,
// but that's tolerable because it ought to be a rare case.
p.urgentAsyncTaskQueue.Enqueue(task)
}
if atomic.CompareAndSwapInt32(&p.wakeupCall, 0, 1) {
Expand Down
2 changes: 2 additions & 0 deletions internal/netpoll/kqueue_optimized_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ func (p *Poller) Trigger(priority queue.EventPriority, fn queue.TaskFunc, arg in
if priority > queue.HighPriority && p.urgentAsyncTaskQueue.Length() >= p.highPriorityEventsThreshold {
p.asyncTaskQueue.Enqueue(task)
} else {
// There might be some low-priority tasks overflowing into urgentAsyncTaskQueue in a flash,
// but that's tolerable because it ought to be a rare case.
p.urgentAsyncTaskQueue.Enqueue(task)
}
if atomic.CompareAndSwapInt32(&p.wakeupCall, 0, 1) {
Expand Down

0 comments on commit efb0d94

Please sign in to comment.