Nasal Loops: Difference between revisions

m
m (nothing much)
Line 74: Line 74:


== settimer loops ==
== settimer loops ==
Loops using <tt>while</tt>, <tt>for</tt>, <tt>foreach</tt>, and <tt>forindex</tt> block all of FlightGear's subsystems that run in the main thread, and can, thus, only be used for instantaneous operations that don't take too long.  
Loops using <tt>while</tt>, <tt>for</tt>, <tt>foreach</tt>, and <tt>forindex</tt> block all of FlightGear's subsystems that run in the main thread for the duration of the loop body, and can, thus, only be used for instantaneous operations that don't take too long.  


For operations that should continue over a longer period, one needs a non-blocking solution. This is done by letting functions call themselves after a timed delay:  
For operations that should continue over a longer period, one needs a non-blocking solution. This is done by letting functions call themselves after a timed delay: