← Questions

Thread-safe scheduler for periodic jobs

0
NuroCodingLast asked May 2026

Write a scheduler that runs functions periodically, at a frequency such as 50 Hz, with schedule and cancel. One thread runs the jobs while other threads may add or cancel them at any time, and the code has to actually run, not just be traced by hand. Handle timing drift and cancellation of a job that is about to run.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding