コード例 #1
0
ファイル: runtime_support_stubs.cpp プロジェクト: pra85/hpx
    void runtime_support::free_component_sync(agas::gva const& g,
        naming::gid_type const& gid, boost::uint64_t count)
    {
        // Determine whether the gid of the component to delete is local or
        // remote
        if (g.prefix == hpx::get_locality() ||
            agas::is_local_address_cached(gid))
        {
            // apply locally
            components::server::runtime_support* p =
                reinterpret_cast<components::server::runtime_support*>(
                      hpx::get_runtime().get_runtime_support_lva());
            p->free_component(g, gid, count);
        }
        else {
            // apply remotely (only if runtime is not stopping)
            typedef server::runtime_support::free_component_action action_type;
            naming::id_type id = get_colocation_id_sync(
                naming::id_type(gid, naming::id_type::unmanaged));

            lcos::packaged_action<action_type, void> p;
            p.apply(id, g, gid, count);
            p.get_future().get();
        }
    }
コード例 #2
0
    void runtime_support::free_component_sync(components::component_type type,
        naming::gid_type const& gid, naming::gid_type const& count)
    {
        typedef server::runtime_support::free_component_action action_type;

        // Determine whether the gid of the component to delete is local or
        // remote
        //naming::resolver_client& agas = appl.get_agas_client();
        if (/*agas.is_bootstrap() || */agas::is_local_address(gid)) {
            // apply locally
            applier::detail::apply_helper<action_type>::call(
                applier::get_applier().get_runtime_support_raw_gid().get_lsb(),
                threads::thread_priority_default,
                util::forward_as_tuple(type, gid, count));
        }
        else {
            // apply remotely
            naming::id_type id = get_colocation_id_sync(
                naming::id_type(gid, naming::id_type::unmanaged));

            lcos::packaged_action<action_type, void> p;
            p.apply(launch::async, id, type, gid, count);
            p.get_future().get();
        }
    }