Reset & re-init: Difference between revisions

Jump to navigation Jump to search
m
Line 114: Line 114:
** each Subsystem that provides Nasal APIs, needs to implement the bind/unbind APIs to register/release Nasal APIs
** each Subsystem that provides Nasal APIs, needs to implement the bind/unbind APIs to register/release Nasal APIs
** Given the '''add-subsystem'''/'''remove-subsystem''' fgcommands/APIs, we can no longer afford having '''initNasal''FOO''()''' code in FGNasalSys::init() that depends on other subsystems being present. Subsystem-specific APIs must never be unconditionally added, they need to be added/released (managed) by the underlying subsystem itself, or things will break inevitably.
** Given the '''add-subsystem'''/'''remove-subsystem''' fgcommands/APIs, we can no longer afford having '''initNasal''FOO''()''' code in FGNasalSys::init() that depends on other subsystems being present. Subsystem-specific APIs must never be unconditionally added, they need to be added/released (managed) by the underlying subsystem itself, or things will break inevitably.
* when re-ordering SGSubsystem initialization in fgCreateSubsystems I noticed that /some/ of its systems are pretty sensitive to ordering issues, which is non-obvious because things will typically "work", until the next reset, which is when race conditions may show up (or not). We should strive to formalize such dependencies and then encapsulate them using SGSubsystemGroups - which will also be useful to better establish threading-dependencies. For the time being, it helps to shut down '''all''' background threads manually when resetting.
* getting rid of singletons could help simplify the init process
* getting rid of singletons could help simplify the init process
* Once we use a PropertyObject<int> for '''idle_state''' in main.cxx, we can easily use Nasal to implement the whole splash screen loop in '''fgIdleFunction()''' using a single listener.
* Once we use a PropertyObject<int> for '''idle_state''' in main.cxx, we can easily use Nasal to implement the whole splash screen loop in '''fgIdleFunction()''' using a single listener.

Navigation menu