title: Java - processing documents in parallel
body: <p>I have 5 documents(say) and I have some processing on each of them. Processing here includes open the document/file, read the data, do some document manipulation(edit text etc). For document manipulation I will probably be using docx4j or apache-poi. But my use case is this - I want to somehow process these 4-5 documents in parallel utilizing multiple cores available to me on my CPU. The processing on each document is independent of each other. </p>
  
  <p>What would be the best way to achieve this parallel processing in Java. I have used <code>ExecutorService</code> in java before and <code>Thread</code> class too.  But I dont have much idea about the newer concepts like <code>Streams</code> or <code>RxJava</code>. Can this task be achieved by using Parallel Stream in Java as introduced in Java 8? What would be better to use Executors/Streams/Thread Class etc. If Streams can be used please provide a link where I can find some tutorial on how to do that. Thanks for your help!</p>