MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ResolveTaskPoolThreadCount

Function ResolveTaskPoolThreadCount

engine/Poseidon/Core/TaskPool.cpp:164–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164uint32_t ResolveTaskPoolThreadCount(int cliOverride, unsigned hardwareThreads)
165{
166 if (cliOverride > 0)
167 {
168 return static_cast<uint32_t>(cliOverride); // explicit count
169 }
170 if (cliOverride == 0)
171 {
172 return 0; // uncapped — 0 makes enkiTS use every logical core
173 }
174 // auto: cap at the default, but never request more threads than the machine has.
175 const unsigned cores = hardwareThreads > 0 ? hardwareThreads : kDefaultMaxTaskThreads;
176 return std::min<unsigned>(cores, kDefaultMaxTaskThreads);
177}
178
179enki::TaskScheduler* TaskPool::RawScheduler()
180{

Callers 2

ParseCommandLineMethod · 0.85
test_task_pool.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected