LRAUV  revA
Sequential Nested threads

Post PDR, various multi-treading approaches were tested.

  • Single thread (Collaborative Multitasking)
    • Fault detection & isolation difficult (a la Windows 3.1)
  • Parallel threads (Preemptive Multitasking)
    • Complicated detection of "hung" thread
    • Performance penalty (ARM arch & SD i/o)
  • Sequential, nested threads
    • Reasonable compromise
    • One thread runs at a time
    • The basic idea is that each Component of code (except for Behavior instances) is wrapped by Handler class that manages its execution. Each Handler has an instance of the PCaller class, which contains an instance of pthread.
    • PCallers have the notion of parent and child threads – in this context, the SyncHandler owns all the PCallers in the control cycle, while the SupervisorHandler owns the SyncHandler and other independent threads (such as the Handler for CommandLine).
    • PCallers only allow one child thread to run at a time – since there is only one SupervisorHandler over all the other Handler instances, then only one thread will run at a time in the entire vehicle.
    • However, since all blocks of code run in their own threads, signals can be trapped and logged, and the components can be re-run if necessary.
des_threads.png