Bird
0
0

Given this Spring Boot configuration snippet, what is the maximum number of threads that can run concurrently?

medium📝 component behavior Q4 of 15
Spring Boot - Async Processing
Given this Spring Boot configuration snippet, what is the maximum number of threads that can run concurrently? @Bean public ThreadPoolTaskExecutor threadPoolTaskExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(3); executor.setMaxPoolSize(6); executor.setQueueCapacity(10); executor.initialize(); return executor; }
A3
B10
C6
D13
Step-by-Step Solution
Solution:
  1. Step 1: Understand core and max pool size

    Core pool size is minimum threads, max pool size is maximum threads allowed.
  2. Step 2: Identify maxPoolSize value

    Max pool size is set to 6, so up to 6 threads can run concurrently.
  3. Final Answer:

    6 -> Option C
  4. Quick Check:

    Max threads = maxPoolSize = 6 [OK]
Quick Trick: Max threads = maxPoolSize setting [OK]
Common Mistakes:
  • Confusing queue capacity with max threads
  • Using core pool size as max threads
  • Adding queue capacity to max pool size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes