Skip to content

TParallel.ForEach<T> N'éxist plus dans l'official System.Threading.pas #2

Description

@MBenDelphi

var
Liste: TList;
begin
Liste := TList.Create;
try
// Remplir la liste
Liste.Add('Fichier1.txt');
Liste.Add('Fichier2.txt');
Liste.Add('Fichier3.txt');

// Traiter chaque élément en parallèle
TParallel.ForEach<string>(Liste,
  procedure(const Element: string)
  begin
    TraiterFichier(Element);
  end
);

finally
Liste.Free;
end;
end;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions