Simulated CPU scheduler written in C