Self-tuning schedulers for legacy real-time applications