+simgrid::s4u::Actor* ActorImpl::restart()
+{
+ XBT_DEBUG("Restarting process %s on %s", get_cname(), host_->get_cname());
+
+ // retrieve the arguments of the old process
+ simgrid::kernel::actor::ProcessArg arg = ProcessArg(host_, this);
+
+ // kill the old process
+ SIMIX_process_kill(this, (this == simix_global->maestro_process) ? this : SIMIX_process_self());
+
+ // start the new process
+ ActorImpl* actor = simix_global->create_process_function(arg.name.c_str(), std::move(arg.code), arg.data, arg.host,
+ arg.properties.get(), nullptr);
+ simcall_process_set_kill_time(actor, arg.kill_time);
+ actor->set_auto_restart(arg.auto_restart);
+
+ return actor->ciface();
+}
+
+smx_activity_t ActorImpl::suspend(ActorImpl* issuer)
+{
+ if (suspended_) {
+ XBT_DEBUG("Actor '%s' is already suspended", get_cname());
+ return nullptr;
+ }
+
+ suspended_ = true;
+
+ /* If we are suspending another actor that is waiting on a sync, suspend its synchronization. */
+ if (this != issuer) {
+ if (waiting_synchro)
+ waiting_synchro->suspend();
+ /* If the other actor is not waiting, its suspension is delayed to when the actor is rescheduled. */
+
+ return nullptr;
+ } else {
+ return SIMIX_execution_start("suspend", "", 0.0, 1.0, 0.0, this->host_);
+ }
+}
+
+void ActorImpl::resume()
+{
+ XBT_IN("process = %p", this);
+
+ if (context_->iwannadie) {
+ XBT_VERB("Ignoring request to suspend an actor that is currently dying.");
+ return;
+ }
+
+ if (not suspended_)
+ return;
+ suspended_ = false;
+
+ /* resume the synchronization that was blocking the resumed actor. */
+ if (waiting_synchro)
+ waiting_synchro->resume();
+
+ XBT_OUT();
+}
+
+smx_activity_t ActorImpl::sleep(double duration)
+{
+ if (host_->is_off())
+ throw_exception(std::make_exception_ptr(simgrid::HostFailureException(
+ XBT_THROW_POINT, std::string("Host ") + std::string(host_->get_cname()) + " failed, you cannot sleep there.")));
+
+ simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
+ synchro->host = host_;
+ synchro->surf_sleep = host_->pimpl_cpu->sleep(duration);
+ synchro->surf_sleep->set_data(synchro);
+ XBT_DEBUG("Create sleep synchronization %p", synchro);
+
+ return synchro;
+}
+
+void ActorImpl::throw_exception(std::exception_ptr e)