- * In the future, it might be extended in order to attach other threads created by a third party library.
- */
-msg_process_t MSG_process_attach(const char *name, void *data, msg_host_t host, xbt_dict_t properties)
-{
- xbt_assert(host != nullptr, "Invalid parameters: host and code params must not be nullptr");
- std::map<std::string, std::string> props;
- xbt_dict_cursor_t cursor = nullptr;
- char* key;
- char* value;
- xbt_dict_foreach (properties, cursor, key, value)
- props[key] = value;
- xbt_dict_free(&properties);
-
- /* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
- smx_actor_t process = SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->getCname(), &props, nullptr);
- if (not process)
- xbt_die("Could not attach");
- simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
- return process->ciface();
-}
-
-/** Detach a process attached with `MSG_process_attach()`
- *
- * This is called when the current process has finished its job.
- * Used in the main thread, it waits for the simulation to finish before returning. When it returns, the other
- * simulated processes and the maestro are destroyed.
- */
-void MSG_process_detach()
-{
- SIMIX_process_detach();
-}
-
-/** \ingroup m_process_management
- * \param process poor victim
- *
- * This function simply kills a \a process... scary isn't it ? :)
- */
-void MSG_process_kill(msg_process_t process)
-{
- process->kill();
-}
-
-/**
-* \brief Wait for the completion of a #msg_process_t.
-*
-* \param process the process to wait for
-* \param timeout wait until the process is over, or the timeout occurs
-*/
-msg_error_t MSG_process_join(msg_process_t process, double timeout){
- simcall_process_join(process->getImpl(), timeout);
- return MSG_OK;
-}
-
-/** \ingroup m_process_management
- * \brief Migrates a process to another location.
- *
- * This function checks whether \a process and \a host are valid pointers and change the value of the #msg_host_t on
- * which \a process is running.
- */
-msg_error_t MSG_process_migrate(msg_process_t process, msg_host_t host)
-{
- TRACE_msg_process_change_host(process, host);
- process->migrate(host);
- return MSG_OK;
-}
-
-/** Yield the current actor; let the other actors execute first */
-void MSG_process_yield()
-{
- simgrid::simix::kernelImmediate([] { /* do nothing*/ });
-}
-
-/** \ingroup m_process_management
- * \brief Returns the user data of a process.
- *
- * This function checks whether \a process is a valid pointer and returns the user data associated to this process.