This was intended to help NS3 users, but that's not a netcard.
That's a point in the routing algorithm, let's avoid do wrong simplifications.
+ MSG
+ - New function: MSG_process_yield()
+
Java
- Ensure that an actor can kill itself with Process::exit()
XBT_PUBLIC(void) MSG_process_kill(msg_process_t process);
XBT_PUBLIC(int) MSG_process_killall(int reset_PIDs);
XBT_PUBLIC(msg_error_t) MSG_process_migrate(msg_process_t process, msg_host_t host);
+XBT_PUBLIC(void) MSG_process_yield();
XBT_PUBLIC(void *) MSG_process_get_data(msg_process_t process);
XBT_PUBLIC(msg_error_t) MSG_process_set_data(msg_process_t process,
*/
void MSG_process_kill(msg_process_t process)
{
-// /* FIXME: why do we only cancel communication actions? is this useful? */
-// simdata_process_t p_simdata = simcall_process_get_data(process);
-// if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) {
-// simcall_comm_cancel(p_simdata->waiting_task->simdata->comm);
-// }
simcall_process_kill(process);
}
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.
*
*/
void SIMIX_process_yield(smx_actor_t self)
{
- XBT_DEBUG("Yield process '%s'", self->name.c_str());
+ XBT_DEBUG("Yield actor '%s'", self->cname());
/* Go into sleep and return control to maestro */
self->context->suspend();
#include "popping_bodies.cpp"
-void simcall_call(smx_actor_t process)
+void simcall_call(smx_actor_t actor)
{
- if (process != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", process->name.c_str(),
- SIMIX_simcall_name(process->simcall.call), (int)process->simcall.call);
- SIMIX_process_yield(process);
+ if (actor != simix_global->maestro_process) {
+ XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->cname(), SIMIX_simcall_name(actor->simcall.call),
+ (int)actor->simcall.call);
+ SIMIX_process_yield(actor);
} else {
- SIMIX_simcall_handle(&process->simcall, 0);
+ SIMIX_simcall_handle(&actor->simcall, 0);
}
}