Skip to content
Permalink
Browse files
Merge pull request #1327 from lorinlee/fix-typo
bthread/timer_thread: fix typo
  • Loading branch information
gydong committed Jan 11, 2021
2 parents b226c34 + c29b614 commit e9d8f8475a50f915ff99d7cc7cfadcdcc44a930b
Showing 1 changed file with 2 additions and 2 deletions.
@@ -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) {

0 comments on commit e9d8f84

Please sign in to comment.