Files
salmanoff/smocore/mind.cpp
T
hayodea 285b63b618 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.
2025-08-03 09:18:45 -04:00

41 lines
925 B
C++

#include <iostream>
#include <mind.h>
#include <componentThread.h>
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(
[]()
{
std::cout << "Mrntt: All mind threads JOLTed." << "\n";
ComponentThread::startAllMindThreadsReq(
[]()
{
std::cout << "Mrntt: All mind threads started." << "\n";
}
);
}
);
}
void Mind::finalize(void)
{
}
} // namespace smo