Transaction mémoire partagée (parallel)
Une seule transaction mémoire partagée :
<source lang="delphi"> //Procedure doCreateA(index:Integer); var inst:WFClasseA; begin
// share the transaction inst := WFClasseA.Create; inst.unCode := 'X'+inttostr(index); inst.Caption := 'Objet A'+inttostr(index); inst.unEntier := 1+Trunc(Random(100));
end;
//Procedure CreateSomeA; var tk:Int64; begin
tk := GetTickCount;
try
withP Transaction do
for var idx:=1 to 10 do
begin
parallel doCreateA(idx);
end;
finally
tk := GetTickCount-tk;
showmessage(Format('%s ms',[TickToString(tk)]));
end;
end; </source>