WorkerPool::GetTaskRunner - what is "slow"?

30 views
Skip to first unread message

Rachel Blum

unread,
Jul 25, 2016, 3:59:05 PM7/25/16
to Chromium-dev, Matt Mueller
I need to run a task that might involve paging in 32K of memory. Which means there's disk IO, dominated by seek time - so on avg, this task is probably shorter than ~14ms (unless you have ancient disks)

Should that be the slow or the fast pool? :)





Gabriel Charette

unread,
Jul 26, 2016, 10:24:40 AM7/26/16
to Chromium-dev, ma...@chromium.org
Short-term answer: |slow| is merely a hint to the OS managed pool that it should probably consider the threads running such tasks as unavailable in the thread pool for the next little while. I don't think paging 32K of memory fits in that range -- especially since this is something the kernel can detect on its own without needing a hint.

Medium-term answer: base/task_scheduler is almost ready to replace the WorkerPool. It will allow call sites to specify TaskTraits that specifically let the scheduler know the characteristics and priority of a group of tasks going through a TaskRunner. We have thought of adding TaskTraits::MayBlock() as a characteristic, but have so far avoided it until the need is obvious -- we instead hope to have the scheduler auto-adjust to detected slow operations.
Reply all
Reply to author
Forward
0 new messages