Is ThreadPoolExecutor's thread doesn't run concurrently with PriorityBlockingQueue
Is ThreadPoolExecutor's thread doesn't run concurrently with PriorityBlockingQueue I am using java ThreadPoolExecutor to run concurrent thread execution. I used ArrayBlockingQueue to keep threads in queue. But now requirement has changed and I need to add thread run time(no size limit) and it should be prioritized. So i decided to use PriorityBlockingQueue instead of ArrayBlockingQueue with some comparison Logic. After using PriorityBlockingQueue, threads are running sequentially one after one not concurrently. Only one thread run at a time, rather than whatever the active thread count will be. Please let me know if anybody have any suggestions to resolve this issue and achieve my requirement(thread should be added in pool at run time and it execution should be based on priority). My demo code: //RejectedExecutionHandler implementation RejectedExecutionHandlerImpl rejectionHandler = new RejectedExecutionHandlerImpl(); //Get the ThreadFactory implementation to use Bl...