5 Higher level logic

With both motion control and sensor sampling interupt driven, how do we perform higher level logic?

 5.1 Synchronzation between an ISR and a thread
 5.2 Sensor/ADC processing
 5.3 Error correction
 5.4 Mapping
 5.5 Floodfill recomputation
 5.6 Motion decision