- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
링크가 복사됨
