You're rigth. If multiple threads are scheduling jobs and the pool has reached
a threadcount of maxsize-1, chances are that a RejectedExecutionException
is thrown. The offer-method should use a lock. Like so:
public boolean offer(Runnable inJob) {
_lock.lock();
try {
if (_exec
I'm not convinced this solution is thread-safe.
On 1 Jul 2014 17:21, "Arjan Verstoep"
wrote:
> Yes, the default implementation is very counter-intuitive. I have
> invesigated once, and it was possible to 'repair' the ThreadPoolExecutor if
> you provide the 'right' work-queue.
>
> I don't know if
Yes, the default implementation is very counter-intuitive. I have invesigated
once, and it was possible to 'repair' the ThreadPoolExecutor if you provide the
'right' work-queue.
I don't know if you can apply this to Tapestry's ThreadPoolExecutor, but
anyhow: here's how I do it:
--Arjan Verstoe
I feel the implementation is flawed.
I would prefer that the pool size would increase from minimum to maximum
under load to increase throughput and then revert back to the minimum when
not under load.
But instead, the pool size stays at minimum until the queue is full. In my
opinion, the applicat
Ok, thanks for explaining this... I think :)
I had a read of the ThreadPoolExecutor javadoc. It seems to me that
core-pool-size should be described as the maximum pool size before queuing.
Describing it as the minimum pool size is misleading because there is no
minimum. The number of threads in
If you read the javadoc for java.util.concurrent ThreadPoolExecutor you'll
see that the number of threads will only increase when the queue has
reached its capacity. Crazy / stupid behaviour if you ask me... But
expected.
I've been caught out by this before when I set core pool size to 1,
expectin
Hi
I am using Tapestry 5.3.7 and the ParallelExecutor. When I increase the
max-pool-size I am not able to use any more threads. However when I increase
the core-pool-size I am able to use more threads. It looks like the
max-pool-size is not doing anything (or I am not understanding what it is