Is there any task parallelity in warcraft?
to be more precise, this is my problem:
i have quite a lot of loop code that has to be executed on game begin (= when loadscreen is gone)
now theres the problem that wc3 terminates threads that are working too long
so i tried this:
i turned it to this:
the first code is being terminated at some point, the second one runs through
this makes me think that for each action added to a trigger a new thread is created
if thats so, can there be parallelity problems?
on my computer the 100 executions of method loopcode are all 1 after the other, but i only have a weak dual core without hyperthreading
to be more precise, this is my problem:
i have quite a lot of loop code that has to be executed on game begin (= when loadscreen is gone)
now theres the problem that wc3 terminates threads that are working too long
so i tried this:
JASS:
struct Test
private static method init takes nothing returns nothing
local integer i = 0
call DestroyTimer(GetExpiredTimer())
loop
exitwhen i == 100
call work()
set i = i+1
endloop
endmethod
private static method onInit takes nothing returns nothing
call TimerStart(CreateTimer(), 0, false, function thistype.init)
endmethod
endstruct
i turned it to this:
JASS:
struct Test
private static integer i = 0
private static method loopcode takes nothing returns nothing
call work()
set i = i+1
endmethod
private static method init takes nothing returns nothing
local trigger trig = CreateTrigger()
local integer k = 0
loop
exitwhen k == 100
call TriggerAddAction(trig, function thistype.loopcode)
set k = k+1
endloop
call TriggerExecute(trig)
endmethod
private static method onInit takes nothing returns nothing
call TimerStart(CreateTimer(), 0, false, function thistype.init)
endmethod
endstruct
the first code is being terminated at some point, the second one runs through
this makes me think that for each action added to a trigger a new thread is created
if thats so, can there be parallelity problems?
on my computer the 100 executions of method loopcode are all 1 after the other, but i only have a weak dual core without hyperthreading
Last edited by a moderator: