package com
import java
import ncurrent
import ncurrent
import llections
/**
* 類
* @author yangtb
* 時間
*
*/
public class ThreadPool {
private ExecutorService exe=null;//線程池
public ThreadPool(int pool_size)
{
exe=Executors
System
}
/**
* 運行循環實例線程
* @param worknum
*/
public void server(int worknum
{
int i=
while(i<worknum)
{
//實例指定個線程
WorkerThreadImpl t = new WorkerThreadImpl(id);
exe
i++;
}
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26215.html