Recent

Author Topic: Lazarus equivalent code to Delphi TParallel.For  (Read 1862 times)

Paolo

  • Hero Member
  • *****
  • Posts: 639
Lazarus equivalent code to Delphi TParallel.For
« on: March 14, 2021, 10:24:58 am »
Hello,

There is in Lazarus/FPC the equivalent to TParallel.For in Delphi ? for code like this what library I have to install ? (Win 10 64, Laz 2.0.12, FPC 3.2.0),
are there alternatives in case of no equivalent exists ?

thank you in advance.

Code: Pascal  [Select][+][-]
  1.   TParallel.For(gIniParam, gEndParam, procedure (I: Integer)
  2.   var
  3.     k : integer;
  4.     blah...blah;
  5.   begin
  6.     k:=0;
  7.     Do(I);  //here main task
  8.     Blah..., blah...
  9.   end;
  10. end;
  11.  

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 879
Re: Lazarus equivalent code to Delphi TParallel.For
« Reply #1 on: March 14, 2021, 01:53:51 pm »
First of all, FPC doesn't support closures now, so exactly this syntax isn't available for sure.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Lazarus equivalent code to Delphi TParallel.For
« Reply #2 on: March 14, 2021, 03:20:34 pm »
Unit MTProcs, package multithreadprocslaz

or

BeRo's PasMP:
« Last Edit: March 14, 2021, 03:26:26 pm by engkin »

Paolo

  • Hero Member
  • *****
  • Posts: 639
Re: Lazarus equivalent code to Delphi TParallel.For
« Reply #3 on: March 15, 2021, 12:07:29 pm »
Thanks to all

 

TinyPortal © 2005-2018