There is no universally correct thread count or queue capacity. Choose them together based on your runtime’s executor behavior, whether tasks block, your resource limits, latency and throughput goals, and what the application should do when capacity runs out. For Java’s ThreadPoolExecutor, queue choice directly affects whether the pool grows beyond its core size; other runtimes, including Python’s ThreadPoolExecutor, use different controls.
Start with the executor your application actually uses
Before tuning, identify the programming language, runtime version, and executor implementation. The terms “pool size” and “queue capacity” do not imply the same behavior everywhere. The details below about core and maximum pool sizes apply to Java SE 26’s ThreadPoolExecutor, not to every Java executor or other language’s thread pool.
Python 3.12.15 documents concurrent.futures.ThreadPoolExecutor in terms of a maximum worker count. Do not assume that its behavior or controls match Java’s core/maximum/queue mechanics. See the Python 3.12.15 documentation.
How Java ThreadPoolExecutor uses its queue and pool bounds
Java’s submission order explains why queue capacity and maximum pool size must be tuned together. As described in the Java SE 26 ThreadPoolExecutor API documentation:
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- When the number of running workers is below
corePoolSize, submitting a task creates a worker, even if an existing worker is idle. - Once the core size is reached, the executor prefers to put new tasks in the work queue.
- If the queue cannot accept a task, the executor considers creating another worker, up to
maximumPoolSize. - If the queue cannot accept the task and the maximum pool size has been reached, the task is rejected according to the configured
RejectedExecutionHandler.
This has an important consequence: an unbounded queue generally makes maximumPoolSize ineffective. After the core size is reached, tasks can keep entering the queue, so the queue does not trigger growth toward the maximum.
Choose a queue strategy to match the overload you expect
Direct handoff with SynchronousQueue
A SynchronousQueue does not retain tasks for later execution. If a worker cannot take a submitted task immediately, the executor considers creating a worker, subject to its maximum. Oracle notes that direct handoff can help avoid lockups when tasks depend on one another. However, avoiding rejection under load may require a very large maximum pool, which can allow thread counts to grow dangerously during sustained overload.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Unbounded queue
An unbounded queue can absorb temporary bursts without requiring a larger pool. But if tasks arrive faster than workers complete them for a sustained period, queued work can grow without a fixed limit. In Java, it also means the pool generally stays at corePoolSize, even if maximumPoolSize is set higher.
Bounded queue
A bounded queue limits how much work can wait. With finite core and maximum thread counts, it also helps constrain queued and running work. The trade-off is explicit saturation: when all workers are occupied and the queue is full, new submissions trigger the rejection policy. Set the queue capacity and maximum thread count as a pair, and decide how the application will handle rejected work or apply backpressure.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Balance resource use, throughput, and delay
Pool and queue settings trade off resource consumption against throughput and waiting time. Oracle’s Java SE 26 API documentation states: “Using large queues and small pools minimizes CPU usage, OS resources, and context-switching overhead, but can lead to artificially low throughput.” A large queue can also let tasks wait longer before execution. Smaller queues tend to require a larger pool to keep work moving, potentially increasing scheduling and context-switching overhead.
Tasks that frequently block, such as on I/O, can change the balance: more threads may be useful because blocked workers are not making progress on other tasks. This is a factor to evaluate, not a universal sizing formula. Processor count alone does not determine an appropriate pool size.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Build a workload-specific configuration
Compare candidate settings using the conditions your service actually faces. Record these factors before changing pool or queue values:
- Task behavior: whether work is CPU-bound, frequently blocked, or a mix.
- Pool bounds: Java’s
corePoolSizeandmaximumPoolSize, or the relevant controls in your runtime. - Queue policy: direct handoff, unbounded queue, or bounded queue, including its capacity where applicable.
- Arrival pattern: typical bursts and how long they last, as well as sustained demand.
- Service goals: desired throughput and latency, including how much waiting time is acceptable.
- Resource limits: CPU and memory budgets, plus the operating system’s practical thread capacity.
- Overload behavior: queue depth and wait time at saturation, and the rejection or backpressure action.
Test candidate configurations under representative load, including bursts and sustained demand. Observe throughput, latency, queue growth and waiting time, active thread count, and whether rejections occur. Keep values only if those measurements meet the application’s goals and resource limits; no source-backed general formula can choose numeric settings without those workload details.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchBest Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Plan what happens when Java reaches capacity
For Java’s ThreadPoolExecutor, bounded-queue saturation invokes a RejectedExecutionHandler. The API documents, among other built-in examples:
AbortPolicythrowsRejectedExecutionException, allowing the caller to handle the failed submission.CallerRunsPolicyruns the task on the thread that submitted it, slowing that caller while the task executes.
Select a response that fits the application’s correctness and latency requirements. Rejection is not merely a tuning detail: it is the point at which the system must refuse, delay, or otherwise manage additional work.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

