Csantucci, on 10 December 2014 - 09:54 PM, said:
can you please post a patch for this? I just had again the crash, see attached file.
I have not totally dispensed with the Interlocked Compare Exchange because I understand the reasons for getting away from Lock processing. Locked code can cause bad bottlenecks. Since the Update process was spending the most time in the locked state I've therefore made it interruptible and restartable (sort of) using Compare Exchange. This allows the short Add and Remove Soundsource processes access immediately they need it. These processes are used in bursts when tiles are loaded/unloaded and AI trains are created/removed. If they are held up, they can be a contributory cause of the game stuttering. I've also made Sleeptime variable depending on the sound update response time in an effort to allow heavy bursts of activity through more quickly. To this end, I've also removed the "once every 4 cycle update except for NeedsFrequentUpdate" code. I'm afraid a lot of my debugging / monitoring code is in this patch; some of my stats calculation in cases of heavy interruption of the Update process leaves something to be desired but it was good enough for my purposes. I have some very sound dense activities and I was getting these crashes as soon as the new method of serialisation was introduced.
The Sound Debug Form also crashes randomly because of the same problem. Just leave the form up while running the game, it will crash sooner or later. I haven't looked at how to cure that yet. I hope this gives you some ideas about a more elegant and permanent solution. The patch is based on X2698
Dennis
SoundProcess__ElvasTower.zip (2.26K)
Number of downloads: 185