Setting up a task The "classic" approach to RT tasks is as follows: void random_task(some_arg) { init_this(); init_that; while (1) { work_on_this(); work_on_that; os_wait_next_period(); } } Beautiful, isn't it?