GDC Vault is part of the Informa Tech Division of Informa PLC
This is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.
Multitasking with Coroutines
Tasklets, as a form of cooperative multitasking, are used in EVE Online to drastically simplify program flow in scripts that need to run over multiple frames. Multithreaded programming works well for many things, but sometimes, especially in scripting, cooperative multitasking still has its place. This presentation describes how tasklets are used in EVE, both in the client as well as on the server, showing examples of what tasklets are used for, with Python code samples. The program flow using tasklets is compared to some alternatives, such as using state machines or multiple OS threads. The implementation of tasklets in Stackless Python as used in EVE Online is discussed, as well as some alternatives, such as using regular CPython with greenlets, or Lua using coroutines.
Did you know free users get access to 30% of content from the last 2 years?