package comtendernmemerisdrawexpertserviceimpl;
import javautilList;
import ncurrentExecutorService;
import ncurrentExecutors;
import llectionsmapListOrderedMap;
/**
* 类线程池类控制程序线程实例个数并实例线程
* @author yangtb
* 时间//
*
*/
public class ThreadPool {
private ExecutorService exe=null;//线程池
public ThreadPool(int pool_size)
{
exe=ExecutorsnewFixedThreadPool(pool_size);//创建线程池
Systemoutprintln(the server is ready);
}
/**
* 运行循环实例线程根据要实例的线程个数传入条件ID
* @param worknum
*/
public void server(int worknumString id)
{
int i=;
while(i<worknum)
{
//实例指定个线程
WorkerThreadImpl t = new WorkerThreadImpl(id);
exeexecute(t);//放入线程池
i++;
}
}
}