Page 1 of 1

extreme cpu usage

PostPosted: Fri Jan 20, 2012 13:10
by jordan4ibanez
i have a good pc..but when we detonate alot of nukes i can hear my hard disk crying and ONLY THE GAME lags..i can do other things normally...but the game just locks up

PostPosted: Fri Jan 20, 2012 13:38
by sfan5
There is no extra Thread for the Lua Operations, so it lags

PostPosted: Fri Jan 20, 2012 13:42
by neko259
sfan5 wrote:There is no extra Thread for the Lua Operations, so it lags

Hmm, that's bad. Why doesn't every mod run in its own thread?

PostPosted: Fri Jan 20, 2012 13:43
by sfan5
neko259 wrote:
sfan5 wrote:There is no extra Thread for the Lua Operations, so it lags

Hmm, that's bad. Why doesn't every mod run in its own thread?

idk, someone should make a patch

PostPosted: Fri Jan 20, 2012 13:44
by jordan4ibanez
If some one does this will fix world edit for large areas

PostPosted: Fri Jan 20, 2012 13:46
by sfan5
jordan4ibanez wrote:If some one does this will fix world edit for large areas

Right!
Lua Mods should be at least be able to create and run Threads

PostPosted: Fri Jan 20, 2012 13:51
by neko259
I don't think mods should do this. Such things are the purpose of the engine.

PostPosted: Fri Jan 20, 2012 14:50
by jordan4ibanez
neko259 wrote:I don't think mods should do this. Such things are the purpose of the engine.

NO..certain mods run better within other threads..some run better on their own thread

PostPosted: Fri Jan 20, 2012 16:00
by neko259
Then mods should start in their own thread and be able to created even more threads by their own.
Of course number of threads must be limited to prevent system overload.

PostPosted: Fri Jan 20, 2012 17:15
by randomproof
Most of the mod functions are done in callbacks from the server, so running each mod in a separate thread really doesn't make sense. You would also have problems with two or more threads reading/writing the map at once. It would be a locking nightmare (only one thread could read or write to the map at once) and you would lose performance not gain any.