hpx/components_base/server/migration_support.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace components
template<typename BaseComponent, typename Mutex = hpx::spinlock>
struct migration_support : public BaseComponent
#include <migration_support.hpp>

This hook has to be inserted into the derivation chain of any component for it to support migration.

Public Types

template<>
using decorates_action = void

Public Functions

migration_support()
template<typename T, typename ...Ts, typename Enable = std::enable_if_t<!std::is_same_v<std::decay_t<T>, migration_support>>>
migration_support(T &&t, Ts&&... ts)
~migration_support()
naming::gid_type get_base_gid(naming::gid_type const &assign_gid = naming::invalid_gid) const
void pin()
bool unpin()
std::uint32_t pin_count() const
void mark_as_migrated()
hpx::future<void> mark_as_migrated(hpx::id_type const &to_migrate)
constexpr void on_migrated()

This hook is invoked on the newly created object after the migration has been finished

Public Static Functions

static constexpr bool supports_migration()
template<typename F>
static threads::thread_function_type decorate_action(naming::address_type lva, F &&f)
static std::pair<bool, components::pinned_ptr> was_object_migrated(hpx::naming::gid_type const &id, naming::address_type lva)

Protected Functions

threads::thread_result_type thread_function(threads::thread_function_type &&f, components::pinned_ptr, threads::thread_restart_state state)

Private Types

template<>
using mutex_type = Mutex
template<>
using base_type = BaseComponent
template<>
using this_component_type = typename base_type::this_component_type

Private Members

mutex_type mtx_
std::uint32_t pin_count_
hpx::promise<void> trigger_migration_
bool was_marked_for_migration_