Skip to content

Commit

Permalink
Merge pull request apache#1327 from lorinlee/fix-typo
Browse files Browse the repository at this point in the history
bthread/timer_thread: fix typo
  • Loading branch information
gydong authored Jan 11, 2021
2 parents b226c34 + c29b614 commit e9d8f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bthread/timer_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ TimerThread::TaskId TimerThread::schedule(

// Notice that we don't recycle the Task in this function, let TimerThread::run
// do it. The side effect is that we may allocated many unscheduled tasks before
// TimerThread wakes up. The number is approximiately qps * timeout_s. Under the
// TimerThread wakes up. The number is approximately qps * timeout_s. Under the
// precondition that ResourcePool<Task> caches 128K for each thread, with some
// further calculations, we can conclude that in a RPC scenario:
// when timeout / latency < 2730 (128K / sizeof(Task))
// unscheduled tasks do not occupy addititonal memory. 2730 is a large ratio
// unscheduled tasks do not occupy additional memory. 2730 is a large ratio
// between timeout and latency in most RPC scenarios, this is why we don't
// try to reuse tasks right now inside unschedule() with more complicated code.
int TimerThread::unschedule(TaskId task_id) {
Expand Down

0 comments on commit e9d8f84

Please sign in to comment.