hpx::post (distributed)#
Defined in header hpx/async.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also
-
template<typename F, typename ...Ts>
bool hpx::post(F &&f, Ts&&... ts) Runs the function
fasynchronously (potentially in a separate thread which might be a part of a thread pool). This is done in a fire-and-forget manner, meaning there is no return value or way to synchronize with the function execution (it does not return anhpx::futurethat would hold the result of that function call).hpx::postis particularly useful when synchronization mechanisms as heavyweight as futures are not desired, and instead, more lightweight mechanisms like latches or atomic variables are preferred. Essentially, the post function enables the launch of a new thread without the overhead of creating a future.Note
hpx::postis similar tohpx::asyncbut does not return a future. This is why there is no way of finding out the result/failure of the execution of this function.
-
template<typename Action, typename Client, typename Stub, typename Data, typename ...Ts>
bool hpx::post(components::client_base<Client, Stub, Data> const &c, Ts&&... vs)
-
template<typename Action, typename DistPolicy, typename ...Ts>
bool hpx::post(DistPolicy const &policy, Ts&&... vs)
-
template<typename Action, typename Continuation, typename ...Ts>
bool hpx::post(Continuation &&c, hpx::id_type const &gid, Ts&&... vs)
-
template<typename Action, typename Continuation, typename Client, typename Stub, typename Data, typename ...Ts>
bool hpx::post(Continuation &&cont, components::client_base<Client, Stub, Data> const &c, Ts&&... vs)
-
template<typename Action, typename Continuation, typename DistPolicy, typename ...Ts>
bool hpx::post(Continuation &&c, DistPolicy const &policy, Ts&&... vs)
-
template<typename Action, typename Target, typename ...Ts>
bool hpx::post(Action &&action, Target &&target, Ts&&... ts) The distributed implementation of
hpx::postcan be used by giving an action instance as argument instead of a function, and also by providing another argument with the locality ID or the target ID.- Template Parameters
Action – The type of action instance
Target – The type of target where the action should be executed
Ts – The type of any additional arguments
- Parameters
action – The action instance to be executed
target – The target where the action should be executed
ts – Additional arguments
- Returns
trueif the action was successfully posted,falseotherwise.