Deadlock caused by method requiring threads

I'm currently having trouble figuring out the proper way to do this.

I have a ExecutorService with a fixed thread pool of 64. I'm requesting to download a kind of Book (one at a time). To download a book I need to: download the book info, download page info and then download a part of the book. When I request to download a book I get every page info and in the same method I download those little parts of the book. The problem is downloading those little parts of books is also done asynchronously (requiring another thread) but at the time all of 64 threads are occupied by the page-downloading threads. I've came up with either adding another ExecutorService or lifting the thread pool to some bigger number like 256. But that just don't feels quite right. Do I have any other options?

Since you're executing two different kinds of tasks, and the second one is a subtask of the first one, you end up with the executor being full of the first tasks, which can't finish since their subtasks can't execute. While this is not a classic example of a deadlock, I'd say it qualifies.

The way I would handle this is by removing the use of the executor in getPage(). If for some reason (although I fail to see any valid reason) you want/need to keep the getPage() using multiple threads, you'll have to provide a separate Executor for it to use, so the subtasks will always have a chance to finish.