Bug #757: disable unnecassary network polling in multicore build
[charm.git] / doc / charm++ / sync.tex
blobc17695504f0492b76e360be685562d3640efa6c6
2 \section{Sync Entry Methods}
3 \label{sync}
5 Generally, entry methods are invoked asynchronously and return {\tt void}. Therefore,
6 while an entry method may send data back to its invoker, it can only do so by invoking
7 another asynchronous entry method on the chare object that invoked it.
9 However, it is possible to use \kw{sync} entry methods, which have blocking
10 semantics. The data returned by the invocation of such an entry method is
11 available at the call site when it returns from blocking. This returned data
12 must be in the form of a \charmpp message. Because the caller of a sync entry
13 method will block, it must execute in a thread separate from the scheduler;
14 that is, it must be a \kw{threaded} entry method ({\em cf.} \S~\ref{threaded},
15 above). If a \kw{sync} entry method returns a value, it is provided as the
16 return value from the invocation on the proxy object:
18 \begin{alltt}
19 ReturnMsg* m;
20 m = A[i].foo(a, b, c);
21 \end{alltt}
23 An example of the use of sync entry methods is given in \testrefdir{sync\_square}.