예제 #1
0
naming::gid_type component_storage::migrate_to_here(
    std::vector<char> const& data, naming::id_type id,
    naming::address const& current_lva)
{
    naming::gid_type gid(naming::detail::get_stripped_gid(id.get_gid()));
    data_[gid] = data;

    // rebind the object to this storage locality
    naming::address addr(current_lva);
    addr.address_ = 0;       // invalidate lva
    if (!agas::bind(launch::sync, gid, addr, this->gid_))
    {
        std::ostringstream strm;
        strm << "failed to rebind id " << id
             << "to storage locality: " << gid_;

        HPX_THROW_EXCEPTION(duplicate_component_address,
                            "component_storage::migrate_to_here",
                            strm.str());
        return naming::invalid_gid;
    }

    id.make_unmanaged();            // we can now release the object
    return naming::invalid_gid;
}
예제 #2
0
    void trigger_lco_event(naming::id_type const& id, naming::address && addr,
        naming::id_type const& cont, bool move_credits)
    {
        typedef lcos::base_lco::set_event_action set_action;
        typedef
            hpx::traits::extract_action<set_action>::local_result_type
            local_result_type;
        typedef
            hpx::traits::extract_action<set_action>::remote_result_type
            remote_result_type;
        if (move_credits &&
            id.get_management_type() != naming::id_type::unmanaged)
        {
            naming::id_type target(id.get_gid(), id_type::managed_move_credit);
            id.make_unmanaged();

            detail::apply_impl<set_action>(
                actions::typed_continuation<
                    local_result_type, remote_result_type>(cont),
                target, std::move(addr), actions::action_priority<set_action>());
        }
        else
        {
            detail::apply_impl<set_action>(
                actions::typed_continuation<
                    local_result_type, remote_result_type>(cont),
                id, std::move(addr), actions::action_priority<set_action>());
        }
    }
예제 #3
0
    void set_lco_error(naming::id_type const& id, boost::exception_ptr const& e)
    {
        naming::id_type target(id.get_gid(), id_type::managed_move_credit);
        id.make_unmanaged();

        lcos::base_lco::set_exception_action set;
        apply(set, target, e);
    }
예제 #4
0
    void trigger_lco_event(naming::id_type const& id, naming::id_type const& cont)
    {
        naming::id_type target(id.get_gid(), id_type::managed_move_credit);
        id.make_unmanaged();

        lcos::base_lco::set_event_action set;
        apply_c(set, cont, target);
    }
예제 #5
0
    void set_lco_error(naming::id_type const& id, //-V659
        boost::exception_ptr && e, naming::id_type const& cont)
    {
        naming::id_type target(id.get_gid(), id_type::managed_move_credit);
        id.make_unmanaged();

        lcos::base_lco::set_exception_action set;
        apply_c(set, cont, target, std::move(e));
    }
예제 #6
0
    void set_lco_error(naming::id_type const& id, naming::address && addr,
        std::exception_ptr const& e, bool move_credits)
    {
        typedef lcos::base_lco::set_exception_action set_action;
        if (move_credits &&
            id.get_management_type() != naming::id_type::unmanaged)
        {
            naming::id_type target(id.get_gid(), id_type::managed_move_credit);
            id.make_unmanaged();

            detail::apply_impl<set_action>(
                target, std::move(addr), actions::action_priority<set_action>(), e);
        }
        else
        {
            detail::apply_impl<set_action>(
                id, std::move(addr), actions::action_priority<set_action>(), e);
        }
    }