Asynchronous Call


Asynchronous Function Call (AFC) allows a function call to be executed as a tasklet, and
return immediately a future value that can be use to block on the tasklet and wait for it
s completion.

Any standard function call followed by !! will start an AFC. 
   1  routine MyFunction( n = 10 )
   2  {
   3      for(var i = 1 : n ) io.writeln( i )
   4  }
   5  var f = MyFunction( 20 ) !!
   6  io.writeln( f.value() )

When multiple methods of a class instance are called in asynchronous mode, their executio
n will be mutually exclusive, namely, at any given time only call (tasklet) can be active
. So in this way, the class instance acts just like a monitor.