FlightGear run levels: Difference between revisions

Jump to navigation Jump to search
Line 8: Line 8:
Basically, this means that there will be lots of refactoring involved for a standalone canvas client, not just C++ code, but also Nasal code.
Basically, this means that there will be lots of refactoring involved for a standalone canvas client, not just C++ code, but also Nasal code.


According to a mailing list discussion in 2006, this is a long-standing issue: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg03373.html
According to a mailing list discussion in 2006, this is a long-standing issue:  
{{cquote|What would simplify this greatly is if subsystem registration was totally separated out from (re-)initialisation, and if sub-systems had run-level or priority associated with them. All the subsystems could be registered via add_subsystem, and then during fgInitSubsystems, the runlevel would gradually advance to the final value. This also means the dependencies between subsystems can be expressed (higher numbers depend on lower numbers), and might make things like reset more simple (lower the run-level back to some determined value, and the bring it back up again).
 
As an additional enhancement, subsystems could be notified of all run-level changes above their threshold. This would solve the Nasal issue; starting up the interpreter (the first part of  FGNasalSys::init) can be done very early (and quickly), and the subsytem would then wait for a relatively high-valued 'init' call before running scripts (the part that needs all other properties to be defined).
 
In the even longer run, we'd actually want to associate the Nasal scripts with run-levels (/etc/rc.d, anyone?), since the frontend GUI might want a few scripts loaded, while I assume most are only relevant when actually flying. Such a change also makes postinit() unnecessary, I think - since the effect can always be achieved by having init() watch for a higher run-level.<ref>{{cite web |url=http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg03373.html
 
|title=Subsystem run-levels|author=James Turner |date=17 April 2006 }}</ref>}}


== Objective ==
== Objective ==


Come up with a design to make subsystem initialization more explicit, and provide dependency resolution (run levels or system groups), so that subsystem initialization can be better controlled and explicitly enabled/disabled during startup.
Come up with a design to make subsystem initialization more explicit, and provide dependency resolution (run levels or system groups), so that subsystem initialization can be better controlled and explicitly enabled/disabled during startup.

Navigation menu