title: How to use Spliterator.trySplit to do parallel computation on N cores?
body: <p>Let's say I have a list of 10000 elements and want to process them on 6 cores. I don't want to use the existing Stream API and want to do it by myself from scratch (for the learning sake). The Spliterator interface seem to fit well for that purpose. However, it divides the collection in half whenever called. I can get 5000-5000 split, and then do one more split to get 2500-2500-2500-2500, and then 2500-2500-2500-1250-1250 to cut my initial collection into 6 parts. It seems unbalanced and no way to balance it over 6 cores.</p>
  <p>From the Java.Doc</p>
  <blockquote>
  <p>API Note: An ideal trySplit method efficiently (without traversal)
  divides its elements exactly in half, allowing balanced parallel
  computation.</p>
  </blockquote>
  <p>However, the Stream .parallel() seems to solve this problem somehow. I tried to read the source, but still unable to get the gist of it. Maybe someone can explain the high level approach to me.</p>