delphi - Can I use OTL to parallelize nested loops? -


i wondering if can use otl parallelize loop.

i have following code.

for := 1 xres  begin    j := 1 xres      begin        gridmat.elem[i,j] := strtofloat(listofvalues[(i-1)+((j-1)*xres)]);      end;    invalidate;  end; 

is possible pass gridmat (from sdl_matrix.tmatrix) parameter parallel foreach , add values it.

if use synchronous version of parallel.foreach (the default one; i.e. if don't use nowait specifier) can access gridmat through variable capture.

something should work:

parallel.foreach(1, xres).execute(   procedure (const i: integer)   var     j: integer;   begin     j := 1 xres       gridmat.elem[i,j] := strtofloat(listofvalues[(i-1)+((j-1)*xres)]);   end); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -