Now we have modularized the Mind class to contain all of its
ComponentThreads. This enables us to run multiple mind instances
within the same SMO process, at least in theory.
We probably won't actually do this, but we want to ensure that the
design is clean enough to enable it.
Gave me some ideas about how things should be structured. Apparently
merely using region-data-locked threads doesn't eliminate the need
for synchronization/locking. It just means your synchronization is much
lighter, in the form of localized variables.
It seems we'll need to maintain boolean trackers for certain
operations that shouldn't be performed concomitantly, and deny
the caller access to those operations in order to preserve
data sanity.
I guess we still ended up using locking after all. Tbh, I'm not even
sure this will make things end up being lighter: we may have to bounce
requests off, or perhaps re-enqueue them into the queue?
So maybe instead of bouncing requests off, we could re-add them to the
rear of the queue when they conflict with an ongoing request.
This language is used broadly to specify how to attach (and thus
also how to detach) devices to/from Salmanoff. The next bit of work
we'll do is split off the DSL parsing from the management of the
list of parsed binary attached spec objects.
We'll be creating a PipeDeviceAttachmentParser, and later on when
we support URDF, we'll create a URDFDeviceAttachmentParser.
We don't post a message to the event loop telling it to execute
initializeSalmanoff anymore. We now execute it in the main control
flow.
Also, we've unified the logic to call finalizeReq() in response to
exceptions in the outermost try block.
This is generally frowned upon but it makes this code 10x cleaner.
We handle commandLine usage msg printing by using exceptions for
control flow. This allows us to centralize the logic for killing
the Mind threads in one place. At least with respect to printing
the usage msg.
We moved the instance of smo::Mind to global scope. I suppose we'll
only support one instance of Mind per SMO process at least for now.
We now track the state of Mind threads' JOLT-waiting. This allows us
to centralize the Mind thread shutdown logic. Mind::finalizeReq()
now takes care of all Mind thread shutdown state logic by tracking
whether Mind threads need to be JOLTed first before being told to
exit.
This allows us to execute an op on all mind threads without having
to repeatedly write loops. We've implemented wrappers to handle
start, pause, resume, exit and JOLT sequences.
These differ from the MentalEntity class hierarchy in that
MentalExistents are a narrower subset of MentalEntities. MentalEntities
refer to all mental content that needs to be persistently stored to
represent cognitive and personna state.
MentalExistents are content of the mind that specifically represents
existents. I.e: perceptual data, whether structural or implicative.