15
« on: October 01, 2014, 03:36:12 am »
After all we know, it could be a sleep(100) statement that Toady forgot somewhere inside the code. It is true that lag occurs more often if certain conditions are present (like zombie invasions, those are always bad, in general), however the cause of it is just pure speculation. And without access to the code, it stays pure speculation. Therefore ideas for fixes might be as beneficial as they might be harmful.
Threading if done right is a very easy way to calculate two things at the same time, however if it is not done right, it has devastating results, mostly because threading bugs are extremely difficult to locate as they seem to happen randomly. I doubt that the DF code is prepared to handle threading, so without a major rewrite, only very few things can be made threaded.
However there are several models for threading, and some - again if implemented correctly - could increase performance significantly. Pathing is a good example for such a task, as it is completely independent from everything else, and therefore could be done in parallel for all entities. I cannot however say anything about Toady's experience with multi-threading, so there might be other reasons why he is not doing it.