[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Coroutines (Thread) Performance
- From: Ivan-Assen Ivanov <ivanassen@...>
- Date: Wed, 13 Jul 2011 18:24:30 +0300
We run 1000s of threads (one or several per entity in the game world)
in games that run on current-gen consoles with their
not-exactly-Lua-loving PowerPC CPUs. The trick is to have them "sleep"
most of the time (e.g. if something is playing an animation which will
last 2.5s and cannot be interrupted, don't resume its Lua thread
before 2.5s have elapsed). The fact of having 1000 Lua threads won't
hurt your performance; what you do with them might.