Re: tapestry.thread-pool.max-pool-size not doing anything

2014-06-30 Thread Lance Java
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,
expecting the thread size to increase under load.
On 1 Jul 2014 02:53, "D Tim Cummings"  wrote:

> 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 supposed to do).
>
> When I use the defaults I get a maximum of 3 threads and other threads
> seem to wait in a queue and execute later.
>
> When I use the following settings in web.xml I still get only 3 threads
>
> 
>   tapestry.thread-pool.core-pool-size 
>   3
> 
> 
>   tapestry.thread-pool.max-pool-size
>   20
> 
>
> When I use the following settings in web.xml I get 3 threads
>
> 
>   tapestry.thread-pool.core-pool-size 
>   3
> 
> 
>   tapestry.thread-pool.max-pool-size
>   200
> 
>
> When I use the following settings in web.xml I get 20 threads
>
> 
>   tapestry.thread-pool.core-pool-size 
>   20
> 
> 
>   tapestry.thread-pool.max-pool-size
>   20
> 
>
> I noticed that the documentation says the default max-pool-size is 20 (
> http://tapestry.apache.org/parallel-execution.html ) while the API docs
> say the default is 10 (
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/IOCSymbols.html
> ).
>
> I am invoking my threads from a service which contains
>
>   @Inject
>   private ParallelExecutor executor;
>
>   @Override
>   public void doStartThread() {
> if ( myFuture == null || myFuture.isDone() ) {
>   myFuture = executor.invoke(new MyInvokable());
> }
>   }
>
> I have tried in Jetty 8.1.2 (Run Jetty Run in Eclipse) and Tomcat 7.0.52.
>
> Cheers
>
> Tim
>


tapestry.thread-pool.max-pool-size not doing anything

2014-06-30 Thread D Tim Cummings
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 
supposed to do).

When I use the defaults I get a maximum of 3 threads and other threads seem to 
wait in a queue and execute later.

When I use the following settings in web.xml I still get only 3 threads


  tapestry.thread-pool.core-pool-size 
  3


  tapestry.thread-pool.max-pool-size
  20


When I use the following settings in web.xml I get 3 threads


  tapestry.thread-pool.core-pool-size 
  3


  tapestry.thread-pool.max-pool-size
  200


When I use the following settings in web.xml I get 20 threads


  tapestry.thread-pool.core-pool-size 
  20


  tapestry.thread-pool.max-pool-size
  20


I noticed that the documentation says the default max-pool-size is 20 ( 
http://tapestry.apache.org/parallel-execution.html ) while the API docs say the 
default is 10 ( 
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/IOCSymbols.html
 ).

I am invoking my threads from a service which contains

  @Inject
  private ParallelExecutor executor;

  @Override
  public void doStartThread() {
if ( myFuture == null || myFuture.isDone() ) {
  myFuture = executor.invoke(new MyInvokable());
}
  }

I have tried in Jetty 8.1.2 (Run Jetty Run in Eclipse) and Tomcat 7.0.52. 

Cheers

Tim


signature.asc
Description: Message signed with OpenPGP using GPGMail