4 package org.pcmm.concurrent;
6 import org.pcmm.base.IAdapter;
11 public interface IWorkerPool extends IAdapter<IWorker> {
13 static int DEFAULT_MAX_WORKERS = 32;
16 * schedules a worker for beginning its task after t milliseconds.
22 * @return the id of the worker (PID) to be used for killing the worker if
25 int schedule(IWorker worker, int t);
28 * schedules a worker for immediate execution.
32 * @return the id of the worker (PID) to be used for killing the worker if
35 int schedule(IWorker worker);
38 * kills the worker with the specified pid
42 void sendKillSignal(int pid);
45 * sends a terminate signal for all active workers and recycles the pool.
50 * cleans up the pool from finished tasks