A robust method for real-time thread simulation