Add comments about Mrntt/Manager vs Mind sync/async design
This commit is contained in:
@@ -90,7 +90,24 @@ void ComponentThread::marionetteMain(ComponentThread& self)
|
|||||||
|
|
||||||
self.getIoService().post([]()
|
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(
|
globalMind->initializeReq(
|
||||||
[](bool success)
|
[](bool success)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user