Mind: Distribute and pin Mind threads to CPUs
At startup, Marionette will distribute and pin the Mind threads across the available CPUs, warning if it couldn't do so.
This commit is contained in:
@@ -6,6 +6,18 @@ namespace smo {
|
||||
|
||||
void Mind::initialize()
|
||||
{
|
||||
/* Distribute threads across available CPUs */
|
||||
try
|
||||
{
|
||||
ComponentThread::distributeAndPinThreadsAcrossCpus();
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Salmanoff couldn't distribute the mind threads across "
|
||||
"the CPUs, so performance may be suboptimal.\n"
|
||||
"Error: " << e.what() << "\n";
|
||||
}
|
||||
|
||||
/* Jolt the threads, then start them */
|
||||
ComponentThread::joltAllMindThreadsReq(
|
||||
[]()
|
||||
|
||||
Reference in New Issue
Block a user