Details
-
Enhancement
-
Status: Open
-
P4
-
Resolution: Unresolved
-
13
-
None
Description
ADDITIONAL SYSTEM INFORMATION :
jdk-13.0.1
A DESCRIPTION OF THE PROBLEM :
Hi,
Please add the option to change the capacity of LinkedBlockingQueue (and possibly other BlockingQueue implementations).
Changing the capacity after instantiation of the queue can allow the program to adjust the queue size based on the actual throughput and thus improve the system performance.
For example, consider the following use case:
Thread A sends HTTP requests and puts the responses in a queue.
Thread B reads from the queue and writes the responses to DB.
The HTTP latency and the DB access latency depend on various factors and the system can detect those at runtime and adjust the queue size accordingly.
It seems that making this change in LinkedBlockingQueue is relatively easy but trying to add this ability from the outside by extending the class is impossible without duplicating large chunks of the code.
A discussion about a resizeable queue can be found here - https://stackoverflow.com/questions/6600023/re-sizeable-java-blockingqueue
Thanks!
jdk-13.0.1
A DESCRIPTION OF THE PROBLEM :
Hi,
Please add the option to change the capacity of LinkedBlockingQueue (and possibly other BlockingQueue implementations).
Changing the capacity after instantiation of the queue can allow the program to adjust the queue size based on the actual throughput and thus improve the system performance.
For example, consider the following use case:
Thread A sends HTTP requests and puts the responses in a queue.
Thread B reads from the queue and writes the responses to DB.
The HTTP latency and the DB access latency depend on various factors and the system can detect those at runtime and adjust the queue size accordingly.
It seems that making this change in LinkedBlockingQueue is relatively easy but trying to add this ability from the outside by extending the class is impossible without duplicating large chunks of the code.
A discussion about a resizeable queue can be found here - https://stackoverflow.com/questions/6600023/re-sizeable-java-blockingqueue
Thanks!