Ignore:
Timestamp:
Jan 24, 2011, 4:15:44 PM (14 years ago)
Author:
george
Message:
  • Added: Preliminary definition of pool thread for multi threaded scheduling.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • MicroThreading/UMicroThreading.pas

    r142 r143  
    7272  TMicroThreadMethod = class(TMicroThread)
    7373    Method: TMicroThreadEvent;
     74    procedure Execute; override;
     75  end;
     76
     77  { TMicroThreadSchedulerPoolThread }
     78
     79  TMicroThreadSchedulerPoolThread = class(TThread)
     80    Scheduler: TMicroThreadScheduler;
    7481    procedure Execute; override;
    7582  end;
     
    125132implementation
    126133
     134{ TMicroThreadSchedulerPoolThread }
     135
     136procedure TMicroThreadSchedulerPoolThread.Execute;
     137var
     138  ExecutedCount: Integer;
     139begin
     140  inherited Execute;
     141  try
     142    repeat
     143      ExecutedCount := Scheduler.Execute(10);
     144      if ExecutedCount = 0 then Sleep(1);
     145    until Terminated;
     146  except
     147    on E: Exception do
     148      //ExceptionHandler(E);
     149  end;
     150end;
     151
    127152{ TMicroThreadMethod }
    128153
Note: See TracChangeset for help on using the changeset viewer.