Adaptive real-time scheduling for legacy applications