Benad's Blog

Software and junk


Previous Entry Add to Memories Tell a Friend Next Entry
FQ1: Java Thread Pools
photo
[info]benad

Java 6 has built-in support for thread pools in the package java.util.concurrent, also available for older version in backport-jsr166.

BTW, if you need a ThreadPoolExecutor that blocks when the underlying queue is full, then implement a RejectedExecutionHandler that, in rejectedExecution(Runnable r, ThreadPoolExecutor executor) calls executor.getQueue().put(r). Somehow, none of the classes provided in the package does that for you.

Tags:

Home