diff --git a/smocore/marionette/marionette.cpp b/smocore/marionette/marionette.cpp index 443814e..0bfa24b 100644 --- a/smocore/marionette/marionette.cpp +++ b/smocore/marionette/marionette.cpp @@ -90,7 +90,24 @@ void ComponentThread::marionetteMain(ComponentThread& self) self.getIoService().post([]() { - // Initialize Mind object (threads) first + /** EXPLANATION: + * Initialize Salmanoff's Manager classes first. + * Manager classes' initialization is synchronous in nature, so we + * don't need the minds to be running to initialize them. + * + * Then we initialize the Minds. Minds are asynchronous and they + * call upon the async methods of the Manager classes. Device + * attachment is actually Mind specific and not Smo-global + * + * It is arguable whether library loading is Mind specific or + * Smo-global. You could argue that libraries should be loaded and + * unloaded dynamically as-needed by the bodies and worlds of + * particular Minds. You could also argue that we should load all + * libraries at startup and unload them at shutdown. + * + * The latter is cleaner and more resource-respecting. The former is + * easier to implement. + */ globalMind->initializeReq( [](bool success) {