1

We are migrating our multi-threaded application to Delphi XE7 and are testing the new TParallel.For function. We have found that it parallelizes well on laptops (Core I-5/Windows 7 with 4 cores) achieving close to consistent 100% cpu usage.

When we run exactly the same code on an Intel Xeon/Windows 2008 R2 with 2x12 cores, it only achieves about 3% usage and appears to be only using 2 of the cores.

The same problem is evident using the Conways Life demo sample application.

We have tried using the OTL which parallelizes close to 100% on the Xeon, but unfortunately we have run into the "Not enough quota" issue and can't seem to resolve that, either.

Has anyone else run into this? We have tried using the Stride parameter, SetMinWorkerThreads and SetMaxWorkerThreads() methods but to no avail.

Community
  • 1
  • 1
Alan Clark
  • 2,017
  • 21
  • 28
  • 1
    The new threading library appears to be of questionable quality. Many bugs have been observed just here on SO. It seems to me that it is not fit for production use. As for a more detailed critique of your specific problems, that would require code. – David Heffernan Apr 16 '15 at 06:08
  • 2
    I haven't tried delphis new paralel library but I would still sugest that you check to see if there is any property which might controll wheter paralel library only uses physical cores or also virtual cores. OTL does have such feature. – SilverWarior Apr 16 '15 at 06:23
  • 1
    @Silver very hard to see how that could be relevant to the question asked. But by default the threading library attempts to use virtual processors. – David Heffernan Apr 16 '15 at 06:38
  • 2
    somehow related to this question http://stackoverflow.com/questions/29062697/strange-behaviour-of-tparallel-for-default-threadpool – Sir Rufo Apr 16 '15 at 07:22
  • If you are only working on a Windows version, why not use the OTL exclusively, see: http://otl.17slon.com/ – Johan Apr 16 '15 at 15:36
  • Thanks all. @David Heffernan sample code is in the Conways Life project, anyway it doesn't seem to matter what is inside the TParallel.For loop. – Alan Clark Apr 16 '15 at 17:00
  • @Sir Rufo very possibly related, could be some incompatability specific to Xeon processors. I haven't yet tried it on other cpus. – Alan Clark Apr 16 '15 at 17:00
  • @Johan I did try the OTL but ran into the quota problem as mentioned. I can use Application.ProcessMessages to mitigate that, but that's less than ideal. – Alan Clark Apr 16 '15 at 17:01

0 Answers0