title: Invoking a function twice by two coroutines simultaneously
body: <p>How to run a function twice by two coroutines simultaneously?
  I tried with this code:</p>
  
  <pre><code>import kotlinx.coroutines.*
  
  fun main() = runBlocking&lt;Unit&gt; {
      launch {
          calculate("first")
      }
      launch {
          calculate("second")
      }
  }
  
  fun calculate(name: String) {
      var value = 0
      for (x in 1..1_000){
          value += 1
          if(x % 100 == 0){
              println("calculating $x for $name")
          }
      }
  }
  </code></pre>
  
  <p>but second coroutine waits until first coroutine leaves the function, to run it!</p>
  
  <p>How am i gonna to do such thing?</p>