Asynchronous cooperative task scheduler