Exemplo n.º 1
0
 public void Run(Worker worker)
 {
     while (worker.IsAlive)
       {
     _pool.AdjustPoolSizeIfNecessary();
     _threadManager.Sleep(TimeSpan.FromSeconds(1.0));
       }
 }
 public override IQueue CreateQueueForWorker(Worker worker)
 {
     using (RWLock.AsWriter(_lock))
       {
     QueueOfRunnables queue = new QueueOfRunnables();
     _queues.Add(queue);
     return queue;
       }
 }
Exemplo n.º 3
0
 public void MarkAsFree(Worker worker)
 {
     Interlocked.Increment(ref _free);
 }
Exemplo n.º 4
0
 public void MarkAsUnavailable(Worker worker)
 {
     MarkAsBusy(worker);
       Interlocked.Decrement(ref _total);
 }
Exemplo n.º 5
0
 public void MarkAsBusy(Worker worker)
 {
     Interlocked.Decrement(ref _free);
 }
Exemplo n.º 6
0
 public void MarkAsAvailable(Worker worker)
 {
     Interlocked.Increment(ref _total);
       MarkAsFree(worker);
 }
Exemplo n.º 7
0
 public override IQueue CreateQueueForWorker(Worker worker)
 {
     return _queue;
 }
Exemplo n.º 8
0
 public WorkerMonitor(BusyWatcher busyWatcher, Worker worker)
 {
     _worker = worker;
       _busyWatcher = busyWatcher;
 }
Exemplo n.º 9
0
 public abstract IQueue CreateQueueForWorker(Worker worker);