Results 1 to 2 of 2

Thread: Issue with number of threads while using SimpleAsyncTaskExecutor

  1. #1
    Join Date
    Dec 2008
    Posts
    10

    Default Issue with number of threads while using SimpleAsyncTaskExecutor

    Hi,

    We are currently using the SimpleAsyncTaskExecutor within our batch application whereby the concurrencyLimit is configurable using a job parameter as shown below:

    Code:
    <bean id="taskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" scope="step">  
        	<!-->property name="concurrencyLimit" value="10"/--> 
        	<property name="concurrencyLimit" value="#{jobParameters[numberOfTreads]}"/>   
        </bean>
    We have noticed odd thing while profiling the application in the sense that more that one thread has been seen running (up to 4 threads with limit set to 0)

    Any explanation on this?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Quote Originally Posted by kissen View Post
    Any explanation on this?
    A quick look at the source code for SimpleAsyncTaskExecutor confirms that concurrencyLimit=0 switches off the concurrency limit because isThrottleActive() checks for >0 (-1 is the default). I'm not sure what you expect to happen if you set the limit to 0 - it doesn't make a lot of sense, so you are lucky it does anything at all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •