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 Thu, 17 Jun 2010 13:26:38 GMT
On 10-06-10 08:06, Gregg Wonderly wrote:
> As was kind of discussed earlier, TPE uses max threads in a different
> way then most people would think.
>
> It creates up to min threads, as long as the "queue is not full"
> (offer() succeeding is "not full"). When the queue is "full", it creates
> up to maxPoolSize threads for (maxPoolSize-corePoolSize) more adds.
>
> So for an open ended queue, maxPoolSize has no meaning, and only
> corePoolSize threads will ever be created it looks to me.
>

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.

Gr. Sim

-- 
QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
Quality Consultancy Group b.v., Leiderdorp, Kvk Den Haag: 28088397

Mime
View raw message