2025-08-03 08:22:45 -04:00
|
|
|
#include <iostream>
|
2024-09-08 01:04:41 +10:00
|
|
|
#include <mind.h>
|
2025-07-30 09:09:38 -04:00
|
|
|
#include <componentThread.h>
|
|
|
|
|
|
|
|
|
|
namespace smo {
|
|
|
|
|
|
|
|
|
|
void Mind::initialize()
|
|
|
|
|
{
|
2025-08-03 09:18:45 -04:00
|
|
|
/* 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";
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-03 08:22:45 -04:00
|
|
|
/* 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";
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-07-30 09:09:38 -04:00
|
|
|
}
|
|
|
|
|
|
2025-07-30 10:14:18 -04:00
|
|
|
void Mind::finalize(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-30 09:09:38 -04:00
|
|
|
} // namespace smo
|