+ * \brief Sends a task on a mailbox.
+ *
+ * This is a non blocking detached send function.
+ * Think of it as a best effort send. The task should
+ * be destroyed by the receiver.
+ *
+ * \param task a #m_task_t to send on another location.
+ * \param alias name of the mailbox to sent the task to
+ * \param cleanup a function to destroy the task if the
+ * communication fails (if NULL, MSG_task_destroy() will
+ * be used by default)
+ */
+void MSG_task_dsend(m_task_t task, const char *alias, void_f_pvoid_t cleanup)
+{
+ simdata_task_t t_simdata = NULL;
+ m_process_t process = MSG_process_self();
+ msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
+
+ CHECK_HOST();
+
+ if (cleanup == NULL) {
+ cleanup = (void_f_pvoid_t) MSG_task_destroy;
+ }
+
+ /* FIXME: these functions are not traceable */
+
+ /* Prepare the task to send */
+ t_simdata = task->simdata;
+ t_simdata->sender = process;
+ t_simdata->source = MSG_host_self();
+
+ xbt_assert(t_simdata->isused == 0,
+ "This task is still being used somewhere else. You cannot send it now. Go fix your code!");
+
+ t_simdata->isused = 1;
+ msg_global->sent_msg++;
+
+ /* Send it by calling SIMIX network layer */
+ SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
+ t_simdata->rate, task, sizeof(void *), NULL, cleanup, 1);
+}
+
+/** \ingroup msg_gos_functions
+ * \brief Starts listening for receiving a task from an asynchronous communication.
+ *
+ * This is a non blocking function: use MSG_comm_wait() or MSG_comm_test()
+ * to end the communication.