相关的代码在
load_servables_fast.h/cc中
const uint32 prev_num_load_threads = manager->num_load_threads();
manager->SetNumLoadThreads(num_threads);
ConnectSourceToTarget(source, manager);
const Status status = wait_until_loaded_fn();
manager->SetNumLoadThreads(prev_num_load_threads);
return status;
如注释中所写:临时增加线程数
// Connects 'source' to 'manager', and speeds up loading of the servables
// matching 'initial_servables'. The speeding up is accomplished by boosting the
// number of threads used for loading until the initial servables have been
// loaded, and then resetting it to the manager's originally configured value.
网友评论