

int x = f(y);  // synchronous function call


Future<int> x = CreateFuture( f, y );  // asynchronous call


// The Future interface has three methods, get(), isDone(), cancel()

int w = x.get(); // block until the future has computed its value


while ( ! x.isDone() ) // poll the future to see if its ready
{
   // do something else
}
w = x.get(); // get the future's value (will not block)


x.cancel() // cancel a future if we know we will never need its value
