package com.tender.nmem.eris.drawexpert.service.impl;

import java.util.List;

import java.util.concurrent.ExecutorService;

import java.util.concurrent.Executors,高级程序员学校;

import org.apache.commons.collections.map.ListOrderedMap;

/**

* 类:线程池类,控制程序线程实例个数,并实例线程

* @author yangtb

* 时间:2009/09/14

*

*/

public class ThreadPool {

private ExecutorService exe=null;//线程池

public ThreadPool(int pool_size)

{

exe=Executors.newFixedThreadPool(pool_size);//创建线程池

System.out.println("the server is ready");

}

/**

* 运行循环实例线程,根据要实例的线程个数,传入条件ID

* @param worknum

*/

public void server(int worknum,String id)

{

int i=0;

while(i

{

//实例指定个线程

WorkerThreadImpl t = new WorkerThreadImpl(id);

exe,高级程序员培训学校.execute(t);//放入线程池

i++;

}

}

}

相关的主题文章: 相关的主题文章:
12-20 19:35