title: Groovy/Grails GPARS: How to execute 2 calculations parallel?
body: <p>I'm new to the GPARS-library and implementing it in our software at the moment.</p>
  
  <p>It's no problem for me to use it instead of the normal groovy-methods like </p>
  
  <pre><code>[..].each{..} 
  -&gt; 
  [..].eachParallel{..}
  </code></pre>
  
  <p>But I'm wondering how to parallelize 2 tasks which are returning a value.</p>
  
  <p>Without GPARS I would do it this way:</p>
  
  <pre><code>List&lt;Thread&gt; threads = []
  def forecastData
  def actualData  
  threads.add(Thread.start {
      forecastData = cosmoSegmentationService.getForecastSegmentCharacteristics(dataset, planPeriod, thruPeriod)
  })
  
  threads.add(Thread.start {
      actualData = cosmoSegmentationService.getMeasuredSegmentCharacteristics(dataset, fromPeriod, thruPeriodActual)
  })
  
  threads*.join()
  
  // merge both datasets
  def data = actualData + forecastData
  </code></pre>
  
  <p>But (how) can this be done with the GparsPool?</p>