Recent

Author Topic: Clever multi TProcess running  (Read 4347 times)

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Clever multi TProcess running
« on: September 30, 2015, 02:55:41 pm »
Hi,

Im trying to run multi TProcess like a multi thread program but I dont know how many I should run.
For example for my computer I can run X process 5 times with 80% sum cpu usage (each one 16%). But for another computer each process get 10% so I can run 8 of them with the same sum cpu usage.
I can use ways like this to get cpu usage value and do the math but I want to know is there a better way?

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Clever multi TProcess running
« Reply #1 on: October 01, 2015, 04:38:08 pm »
Any clever idea? ;)

Basile B.

  • Guest
Re: Clever multi TProcess running
« Reply #2 on: October 01, 2015, 04:49:36 pm »
Use TAsyncProcess. With TProcess it won't work.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Clever multi TProcess running
« Reply #3 on: October 01, 2015, 05:31:39 pm »
Use TAsyncProcess. With TProcess it won't work.
Can you explain more?
How can I know how many process I can create?

derek.john.evans

  • Guest
Re: Clever multi TProcess running
« Reply #4 on: October 01, 2015, 11:58:02 pm »
Hi,

Im trying to run multi TProcess like a multi thread program but I dont know how many I should run.
For example for my computer I can run X process 5 times with 80% sum cpu usage (each one 16%). But for another computer each process get 10% so I can run 8 of them with the same sum cpu usage.
I can use ways like this to get cpu usage value and do the math but I want to know is there a better way?

Wouldn't that be a user setting? I guess you could recommend a process count based on processor speed and memory, but, what if a user wants only 2 processes, because they are running other stuff?


aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Clever multi TProcess running
« Reply #5 on: October 02, 2015, 01:30:08 am »
Yes you are right but in my case I want to use most of the process power but I dont know how estimate count and run them together.

derek.john.evans

  • Guest
Re: Clever multi TProcess running
« Reply #6 on: October 02, 2015, 02:36:59 am »
Mmm. Not sure it is possible. You need to run some kinda test case (if not at least one process) in order to measure its speed.

This reminds me of old 90's 3D games which ran a simple rotating textured polygon to gauge a computers power before setting up various graphics settings.

I guess you could use a bench mark function like this one:
http://www.tempest-sw.com/benchmark/

Wack that in a function and use GetTickCount64 to measure its speed. eg:
Code: Pascal  [Select][+][-]
  1. uses LCLIntf;
  2. function ProcessorSpeed: QWord;
  3. begin
  4.   Result := GetTickCount64;
  5.   ComputePi(2000);
  6.   Result := GetTickCount64 - Result;
  7. end;  
  8.  
« Last Edit: October 02, 2015, 02:54:26 am by Geepster »

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: Clever multi TProcess running
« Reply #7 on: October 03, 2015, 12:09:40 pm »
Thank you Geepster, you showed me a good point.

 

TinyPortal © 2005-2018