1

I have configured 1 threadpool @Async(value="pool_1"). now I want to use this threadpool in different classes, so I put @Async(value="pool_1") above my 2 different class. I just want to get confirmation like it won't create 2 seperate pool of thread. Like I have set my pool size to 500 threads, putting same async on 2 different class, won't set pool size to 1000 right? Also these threads will be SHARED and not be divided between 2 classes right

1 Answer 1

1

Like I have set my pool size to 500 threads, putting same async on 2 different class, won't set pool size to 1000 right?

All methods using @Async(value="pool_1") will use the same single thread pool (i.e. the one you configured with size 500).

Also these threads will be SHARED and not be divided between 2 classes right

There is no upfront allocation of a fixed number of threads to each method (if that is what you asked for).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.