Hey, say for some reason I have a trigger that resembles something like Event: Unit is constructed Action: wait until unit dies, then do x
Pretend, for the sake of this example, that this trigger can't be rewritten into something more efficient.
In this example, a new thread will be opened for each unit that is built and will only close when the unit dies, correct?
So my question is how many active trigger threads like these can you have at a time and does it cause a performance issue?
Having many threads "active" yet sleeping on wait calls doesn't seem to cause any issue.
Yet, there seems to be a fixed maximum of 240 threads active at any time. I haven't confirmed this but others have run some tests. You should make sure your map will never get close to that number, or threads could fail to be created which would lead to some serious problems.
Having many threads "active" yet sleeping on wait calls doesn't seem to cause any issue.
Yet, there seems to be a fixed maximum of 240 threads active at any time. I haven't confirmed this but others have run some tests. You should make sure your map will never get close to that number, or threads could fail to be created which would lead to some serious problems.
Thanks, thats what I was looking for. I'm using this trigger as a temporary solution while I find a better one but I was worried it might have severe impact on the game's performance.
Hey, say for some reason I have a trigger that resembles something like Event: Unit is constructed Action: wait until unit dies, then do x
Pretend, for the sake of this example, that this trigger can't be rewritten into something more efficient. In this example, a new thread will be opened for each unit that is built and will only close when the unit dies, correct?
So my question is how many active trigger threads like these can you have at a time and does it cause a performance issue?
Having many threads "active" yet sleeping on wait calls doesn't seem to cause any issue.
Yet, there seems to be a fixed maximum of 240 threads active at any time. I haven't confirmed this but others have run some tests. You should make sure your map will never get close to that number, or threads could fail to be created which would lead to some serious problems.
Thanks, thats what I was looking for. I'm using this trigger as a temporary solution while I find a better one but I was worried it might have severe impact on the game's performance.
A few patches ago I ran tests on that and I got to 1024 threads until I couldn't create more.
However, it could depend on single/multi-player, performance of your pc (only in single-player) or maybe it was just changed.
I can confirm the 1024 thread limit for singleplayer and the current patch. I highly doubt, it depends on the performance of the pc.