Using coroutines to simulate multi-threading.