org.jgroups.util

Class ThreadPool

public class ThreadPool extends Object

Maintains a set of ReusableThreads. When a thread is to be returned, all existing threads are checked: when one is available, it will be returned. Otherwise, a new thread is created and returned, unless the pool limit is reached, in which case null is returned. Creates threads only as needed, up to the MAX_NUM limit. However, does not shrink the pool when more threads become available than are used.

Author: Bela Ban

UNKNOWN: Shrink thread pool if threads are unused after some configurable time.

Field Summary
protected static Loglog
Constructor Summary
ThreadPool(int max_num)
Method Summary
voiddestroy()
ReusableThreadgetThread()
StringtoString()

Field Detail

log

protected static final Log log

Constructor Detail

ThreadPool

public ThreadPool(int max_num)

Method Detail

destroy

public void destroy()

getThread

public ReusableThread getThread()

toString

public String toString()
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.