User`s guide

Developing an Application [3]
The current rounding mode for the math library is set to round to the nearest place
(RND_NEAR). User functions that change the rounding mode must reset it to
RND_NEAR before calling the math library functions.
Exceptions are handled silently by the math library. No messages are printed, and
errno is not set by the library. If functions return NaN or infinity, these arguments
are propagated silently by the library. Exception flags are raised as appropriate.
3.5 Using Futures in an Application
In your application, a future consists of:
A future statement that creates a continuation pointing to a series of statements
that may be executed by another thread.
An optional future-qualified variable, known as a future variable, that
synchronizes execution of other program threads upon completion of the future.
The name of the future variable is also the name of the future.
Parameters used by the spawning thread to pass values to the thread executing
the future.
The future body, which contains the statements pointed to by the continuation that
may be executed by another thread. The body may end with a return statement
that writes a value to the future variable.
The keyword future is used in two ways:
As a type qualifier for a synchronization variable.
future int x$;
Upon allocation, the full-empty state of the future variable x$ is set to full.
As a statement.
future x$(i)
{
return printf("i is %d\n", i);
}
In the previous statement, the full-empty state for x$ is set to empty. The
argument i is passed in to the future body by value. The stream places the future
on a queue that executes the future bodies asynchronously. Any stream can now
dequeue the future and execute its body. The return value is stored to x$. Finally,
the full-empty bit of x$ is set to full after the return value is stored in x$.
S247920 31