Crossplatform realtime threads planner which provides cooperative multitasking