title: Async and parallel execution functions
body: <p>I have a functions:</p>
  
  <pre><code>int f1(int a)
  {
      return a;
  }
  
  int f2(int a)
  {
      return a*2;
  }
  </code></pre>
  
  <p>I want execute functions async and parallel, waiting results and summing then results. I can use code</p>
  
  <pre><code> var result1 = Task.Run(() =&gt; f1(5));
   var result2 = Task.Run(() =&gt; f2(10));
  
   await Task.WhenAll(result1, result2);
  
   int result = result1.Result + result2.Result;
  </code></pre>
  
  <p>It's cool. But what do, if my functions work with callbacks</p>
  
  <pre><code>void f1(Action&lt;int&gt; action, int a)
  {
      action.Invoke(a);
  }
  
  void f2(Action&lt;int&gt; action, int a)
  {
      a = a*2;
      action.Invoke(a);
  }
  
  f1(result =&gt; Console.WriteLine("result1 = {0}", result), 5);
  f2(result =&gt; Console.WriteLine("result2 = {0}", result), 10);
  </code></pre>
  
  <p>I can't rewrite this functions, this functions using in others code. In this case I can solve the problem that my code didn't resemble hell?</p>