Программа с несколькими потоками
Make(delphi) ver(4.05 build 186) Add(MainForm,2953706,21,105) { Width=971 Height=384 Caption="Wait for Multiple Objects" Position=1 link(onCreate,13804482:doEvent1,[]) } Add(Button,3342741,280,105) { Left=70 Top=15 Width=115 Caption="Start" Data=String(ABCDEF) link(onClick,1818191:doEvent1,[]) } Add(Thread,9400599,441,112) { Delay=0 FastStop=0 link(onExec,9245367:doFor,[(637,118)(637,181)]) } Add(Hub,1818191,329,105) { OutCount=5 link(onEvent1,5114947:doStart,[(375,111)(375,818)]) link(onEvent2,9400599:doStart,[]) link(onEvent3,2883773:doStart,[(392,125)(392,321)]) link(onEvent4,3610323:doStart,[(395,132)(395,496)]) link(onEvent5,7322388:doStart,[(427,139)(427,706)]) } Add(Thread,2883773,441,315) { Delay=0 FastStop=0 link(onExec,15157217:doFor,[(623,321)(623,363)]) } Add(Thread,3610323,448,490) { Delay=0 FastStop=0 link(onExec,6553458:doFor,[(616,496)(616,524)]) } Add(LineBreakEx,12358704,917,259) { Caption="H1" Type=3 link(_Data,5953648:ObjHandle,[]) } Add(LineBreakEx,11815744,903,427) { Caption="H2" Type=3 link(_Data,9593067:ObjHandle,[]) } Add(LineBreakEx,16371797,896,602) { Caption="H3" Type=3 link(_Data,13923820:ObjHandle,[]) } Add(LineBreakEx,4797077,588,630) { Caption="H1" Type=2 } Add(LineBreakEx,12999161,595,651) { Caption="H2" Type=2 } Add(LineBreakEx,777119,602,672) { Caption="H3" Type=2 } Add(WaitMultiple,7791455,588,700) { Count=3 link(onWait,16506042:doEvent1,[(628,706)(628,699)]) link(Handle1,4797077:getVar,[]) link(Handle2,12999161:getVar,[]) link(Handle3,777119:getVar,[]) } Add(Events,9593067,903,385) { Name="" ManualReset=1 } Add(Events,5953648,917,217) { Name="" ManualReset=1 } Add(Events,13923820,896,560) { Name="" ManualReset=1 } Add(LineBreak,1438257,875,217) { Caption="cr1" link(Out,5953648:doCreate,[]) Primary=[3562615,-721,-98] } Add(LineBreak,5260532,854,385) { Caption="cr2" link(Out,9593067:doCreate,[]) Primary=[11905685,-728,-259] } Add(LineBreak,1839924,854,560) { Caption="cr3" link(Out,13923820:doCreate,[]) Primary=[13581513,-700,-427] } Add(Hub,13804482,91,119) { OutCount=3 link(onEvent1,3562615:In,[]) link(onEvent2,11905685:In,[]) link(onEvent3,13581513:In,[]) } Add(For,9245367,770,175) { IncludeEnd=1 link(onEvent,12256453:doOperation,[]) link(onStop,5953648:doSet,[(860,188)(860,230)]) link(End,5403546:Var2,[]) } Add(Math,12256453,994,175) { link(onResult,976171:doValue,[(1123,181)(1123,167)]) link(Op1,9245367:Position,[(1000,163)(888,163)(888,219)(776,219)]) link(Op2,14401824:Var2,[(1007,163)(1095,163)(1095,243)(1182,243)]) } Add(Memory,976171,1176,161) { Default=Integer(0) Point(Data) link(onData,16336590:doAdd,[(1290,167)(1290,181)]) } Add(Edit,8564700,777,28) { Left=15 Top=15 } Add(For,15157217,742,357) { IncludeEnd=1 link(onEvent,10619049:doOperation,[]) link(onStop,9593067:doSet,[(838,370)(838,398)]) link(End,151197:Var2,[]) } Add(Math,10619049,966,357) { link(onResult,12718577:doValue,[(1095,363)(1095,349)]) link(Op1,15157217:Position,[(972,345)(860,345)(860,401)(748,401)]) link(Op2,1542789:Var2,[(979,345)(1067,345)(1067,434)(1154,434)]) } Add(Memory,12718577,1148,343) { Default=Integer(0) Point(Data) link(onData,8720180:doAdd,[(1227,349)(1227,363)]) } Add(GetDataEx,5403546,777,140) { link(Data,8564700:Text,[]) } Add(For,6553458,721,518) { IncludeEnd=1 link(onEvent,16677086:doOperation,[]) link(onStop,13923820:doSet,[(825,531)(825,573)]) link(End,151197:Var1,[(734,306)]) } Add(Math,16677086,945,518) { link(onResult,13916257:doValue,[(1074,524)(1074,510)]) link(Op1,6553458:Position,[(951,506)(839,506)(839,562)(727,562)]) link(Op2,16354893:Var2,[(958,506)(1046,506)(1046,588)(1133,588)]) } Add(Memory,13916257,1127,504) { Default=Integer(0) Point(Data) link(onData,1568353:doAdd,[]) } Add(GetDataEx,151197,749,301) { link(Data,5403546:Var1,[(755,145)]) } Add(Memo,13345728,1057,700) { Left=30 Top=45 Width=220 Height=275 ScrollBars=3 } Add(ArrayEnum,1586077,686,700) { link(onItem,12948517:doWork2,[]) link(onEndEnum,3695970:doEnum,[(737,713)(737,734)]) link(Array,7086870:Var2,[(692,408)(692,408)(1427,408)]) } Add(RealArray,14051834,1421,70) { RealArray=[] } Add(ArrayRW,16336590,1372,161) { link(Array,7086870:Var1,[(1378,131)]) link(Value,14401824:Var3,[(1392,149)(1288,149)(1288,236)]) } Add(GetDataEx,7086870,1421,126) { link(Data,14051834:Array,[]) } Add(ArrayRW,8720180,1274,343) { link(Array,5705375:Var1,[(1280,313)]) link(Value,1542789:Var3,[(1294,331)(1226,331)(1226,397)]) } Add(GetDataEx,14401824,1176,231) { link(Data,976171:Value,[]) } Add(GetDataEx,1542789,1148,392) { link(Data,12718577:Value,[]) } Add(ArrayRW,1568353,1253,490) { link(Array,4005094:Var1,[(1259,464)]) link(Value,16354893:Var3,[(1273,478)(1205,478)(1205,565)]) } Add(GetDataEx,16354893,1127,560) { link(Data,13916257:Value,[]) } Add(Thread,7322388,511,700) { Delay=0 FastStop=0 link(onExec,7791455:doWait,[]) } Add(RealArray,6063749,1330,252) { RealArray=[] } Add(RealArray,13261206,1323,413) { RealArray=[] } Add(ArrayEnum,3695970,756,728) { link(onItem,12948517:doWork3,[(823,734)]) link(onEndEnum,4166759:doEnum,[(821,741)(821,755)]) link(Array,5705375:Var2,[(762,522)(1322,522)]) } Add(GetDataEx,5705375,1316,308) { Angle=1 link(Data,6063749:Array,[(1336,313)]) } Add(HubEx,12948517,819,700) { link(onEvent,9517924:doWork2,[]) } Add(ArrayEnum,4166759,854,749) { link(onItem,9517924:doWork3,[(914,755)]) link(Array,4005094:Var2,[(860,609)(1308,609)]) } Add(GetDataEx,4005094,1302,459) { Angle=1 link(Data,13261206:Array,[(1329,464)]) } Add(HubEx,9517924,910,700) { link(onEvent,13345728:doAdd,[]) } Add(TimeCounter,5114947,1218,812) { link(onStop,10070495:doText,[]) } Add(Label,10070495,1302,819) { Left=205 Top=20 } Add(Hub,16506042,637,693) { link(onEvent1,5114947:doStop,[(935,699)(935,825)]) link(onEvent2,1586077:doEnum,[]) }
Программа с одним потоком
Make(delphi) ver(4.05 build 186) Add(MainForm,2953706,21,105) { Width=971 Height=384 Caption="Wait for Multiple Objects" Position=1 } Add(Button,3342741,280,105) { Left=70 Top=15 Width=115 Caption="Start" Data=String(ABCDEF) link(onClick,1818191:doEvent1,[]) } Add(Thread,9400599,441,112) { Delay=0 FastStop=0 link(onExec,9245367:doFor,[(637,118)(637,181)]) } Add(Hub,1818191,329,105) { link(onEvent1,5114947:doStart,[(375,111)(375,818)]) link(onEvent2,9400599:doStart,[]) } Add(For,9245367,770,175) { IncludeEnd=1 link(onEvent,12256453:doOperation,[]) link(onStop,15157217:doFor,[(814,188)(814,276)(730,276)(730,363)]) link(End,5403546:Var2,[]) } Add(Math,12256453,994,175) { link(onResult,976171:doValue,[(1123,181)(1123,167)]) link(Op1,9245367:Position,[(1000,163)(888,163)(888,219)(776,219)]) link(Op2,14401824:Var2,[(1007,163)(1095,163)(1095,243)(1182,243)]) } Add(Memory,976171,1176,161) { Default=Integer(0) Point(Data) link(onData,16336590:doAdd,[(1290,167)(1290,181)]) } Add(Edit,8564700,777,28) { Left=15 Top=15 } Add(For,15157217,742,357) { IncludeEnd=1 link(onEvent,10619049:doOperation,[]) link(onStop,6553458:doFor,[(786,370)(786,447)(709,447)(709,524)]) link(End,151197:Var2,[]) } Add(Math,10619049,966,357) { link(onResult,12718577:doValue,[(1095,363)(1095,349)]) link(Op1,15157217:Position,[(972,345)(860,345)(860,401)(748,401)]) link(Op2,1542789:Var2,[(979,345)(1067,345)(1067,434)(1154,434)]) } Add(Memory,12718577,1148,343) { Default=Integer(0) Point(Data) link(onData,8720180:doAdd,[(1227,349)(1227,363)]) } Add(GetDataEx,5403546,777,140) { link(Data,8564700:Text,[]) } Add(For,6553458,721,518) { IncludeEnd=1 link(onEvent,16677086:doOperation,[]) link(onStop,16506042:doEvent1,[(765,531)(765,615)(583,615)(583,699)]) link(End,151197:Var1,[(734,306)]) } Add(Math,16677086,945,518) { link(onResult,13916257:doValue,[(1074,524)(1074,510)]) link(Op1,6553458:Position,[(951,506)(839,506)(839,562)(727,562)]) link(Op2,16354893:Var2,[(958,506)(1046,506)(1046,588)(1133,588)]) } Add(Memory,13916257,1127,504) { Default=Integer(0) Point(Data) link(onData,1568353:doAdd,[]) } Add(GetDataEx,151197,749,301) { link(Data,5403546:Var1,[(755,145)]) } Add(Memo,13345728,1057,700) { Left=30 Top=45 Width=220 Height=275 ScrollBars=3 } Add(ArrayEnum,1586077,686,700) { link(onItem,12948517:doWork2,[]) link(onEndEnum,3695970:doEnum,[(737,713)(737,734)]) link(Array,7086870:Var2,[(692,408)(692,408)(1427,408)]) } Add(RealArray,14051834,1421,70) { RealArray=[] } Add(ArrayRW,16336590,1372,161) { link(Array,7086870:Var1,[(1378,131)]) link(Value,14401824:Var3,[(1392,149)(1288,149)(1288,236)]) } Add(GetDataEx,7086870,1421,126) { link(Data,14051834:Array,[]) } Add(ArrayRW,8720180,1274,343) { link(Array,5705375:Var1,[(1280,313)]) link(Value,1542789:Var3,[(1294,331)(1226,331)(1226,397)]) } Add(GetDataEx,14401824,1176,231) { link(Data,976171:Value,[]) } Add(GetDataEx,1542789,1148,392) { link(Data,12718577:Value,[]) } Add(ArrayRW,1568353,1253,490) { link(Array,4005094:Var1,[(1259,464)]) link(Value,16354893:Var3,[(1273,478)(1205,478)(1205,565)]) } Add(GetDataEx,16354893,1127,560) { link(Data,13916257:Value,[]) } Add(RealArray,6063749,1330,252) { RealArray=[] } Add(RealArray,13261206,1323,413) { RealArray=[] } Add(ArrayEnum,3695970,756,728) { link(onItem,12948517:doWork3,[(823,734)]) link(onEndEnum,4166759:doEnum,[(821,741)(821,755)]) link(Array,5705375:Var2,[(762,522)(1322,522)]) } Add(GetDataEx,5705375,1316,308) { Angle=1 link(Data,6063749:Array,[(1336,313)]) } Add(HubEx,12948517,819,700) { link(onEvent,9517924:doWork2,[]) } Add(ArrayEnum,4166759,854,749) { link(onItem,9517924:doWork3,[(914,755)]) link(Array,4005094:Var2,[(860,609)(1308,609)]) } Add(GetDataEx,4005094,1302,459) { Angle=1 link(Data,13261206:Array,[(1329,464)]) } Add(HubEx,9517924,910,700) { link(onEvent,13345728:doAdd,[]) } Add(TimeCounter,5114947,1218,812) { link(onStop,10070495:doText,[]) } Add(Label,10070495,1302,819) { Left=205 Top=20 } Add(Hub,16506042,595,693) { link(onEvent1,5114947:doStop,[(935,699)(935,825)]) link(onEvent2,1586077:doEnum,[]) }
С одним потоком дольше выполняется
|