From: aminer on
Hello,


I have patched Thradpool and to version 1.12..

TPThreadPool.execute look like this - i have used an array
of critical sections, and a local variable 'balance'...to avoid
some problems...


------------------------------------------------------------------------------------------------------------

function TPThreadPool.execute(func:TmyProc;const Context:
Pointer;Priority:byte):Boolean;
var
params: MyParam;
balance:integer;
begin
//new(params);
params:=MYParam.create;
params.proc:=func;
params.param:=context;
balance:=LockedInc(balance1);
if (balance=FThreadCount) then
begin
LockedSub(balance,balance);
LockedSub(balance1,balance1);
end;

cs[balance].enter;
while not Queues[balance].push(TObject(params),priority) do;
if Queues[balance].count<=1 then events[balance].setevent;
cs[balance].leave;
end;
-----------------------------------------------------------------------------------------


Threadpool with priority have been updated also to 1.12

You can download Threadpool version 1.12 from:

http://pages.videotron.com/aminer/


Thank you for your time..


Amine Moulay Ramdane.

From: Gautier write-only on
Did you consider an Ada port ?
Then what is the advantage over Ada's tasks ?
You know perhaps that Ada is parallel since its first version (1983),
and that you can define things like:

task type My_task is...
....
Worker_array: array(Positive range <>) of My_task;
....
my_workers: Worker_array(1..n);

_________________________________________________________
Gautier's Ada programming -- http://sf.net/users/gdemont/
From: Dirk Heinrichs on
Gautier write-only wrote:

> Did you consider an Ada port ?

Did you notice that he completely ignores any reply to his posts?

Bye...

Dirk
From: Gautier write-only on
> Did you notice that he completely ignores any reply to his posts?

Right - I'm beginning to notice :-)