Cooperative multitasking and asynchronous I/O