river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sim IJskes - QCG <...@qcg.nl>
Subject Re: com.sun.jini.thread lock contention
Date Fri, 18 Jun 2010 08:43:28 GMT
On 06/17/2010 03:26 PM, Sim IJskes - QCG wrote:
> So this would be an implementation that will mimmick the old behaviour?
>
>
> ThreadFactory tf = new DaemonThreadFactory();
>
> execSvc = new ThreadPoolExecutor(0, maxThreads, 15L, TimeUnit.MINUTES,
> new LinkedBlockingQueue<Runnable>(1), tf, new AbortPolicy() );
>
> execSvc.allowCoreThreadTimeOut(true);
>
> maxThreads is the limit on the number of threads.

And a possible improvement would be:

tpe = new ThreadPoolExecutor(maxThreads, maxThreads, 15, 
TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), tf, new 
AbortPolicy() );
tpe.allowCoreThreadTimeOut(true);

Gr. Sim

Mime
View raw message