title: Is there an out-of-the-box thread pool with multiple queues (that ensure serial processing of each queue)?
body: <p>Among all my tasks, I have some that must be processed serially (they can never run concurrently and they must be processed in order).</p>
  
  <p>I achieved that creating a separated thread pool with a single thread for each group of tasks that must be executed serially. It works but I don't have the resources for that. I don't control the number of groups, so I might end up with a ridiculous number of threads running simultaneously.</p>
  
  <p>Is there any way I can accomplish that with a single thread pool? Is there a thread pool with multiple blocking queues where I could ensure serial execution for each queue?</p>
  
  <h3>EDIT:</h3>
  
  <p>Just emphasizing what I've said in my second paragraph: I've solved this with a single threaded thread pool for each group of tasks that must be executed serially. I can't go on with this solution, though. There are way too many groups and I can't have all these threads.</p>
  
  <p>I've found this related question, but since it is not very recent, I still created mine. All I'm doing is trying to avoid reinventing the wheel, but it seems I don't have a choice.</p>
  
  <p><a href="https://stackoverflow.com/questions/17972884/does-java-have-an-indexable-multi-queue-thread-pool">Does Java have an indexable multi-queue thread pool?</a></p>