+MSG_error_t MSG_task_get(m_task_t * task, m_channel_t channel)
+{
+ return MSG_task_get_with_timeout(task, channel, -1);
+}
+
+/** \ingroup msg_gos_functions
+ * \brief Listen on a channel and wait for receiving a task with a timeout.
+ *
+ * It takes three parameters.
+ * \param task a memory location for storing a #m_task_t. It will
+ hold a task when this function will return. Thus \a task should not
+ be equal to \c NULL and \a *task should be equal to \c NULL. If one of
+ those two condition does not hold, there will be a warning message.
+ * \param channel the channel on which the agent should be
+ listening. This value has to be >=0 and < than the maximal
+ number of channels fixed with MSG_set_channel_number().
+ * \param max_duration the maximum time to wait for a task before giving
+ up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task
+ will not be modified and will still be
+ equal to \c NULL when returning.
+ * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
+ if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
+ */
+MSG_error_t
+MSG_task_get_with_timeout(m_task_t * task, m_channel_t channel,
+ double max_duration)
+{
+ return MSG_task_get_ext(task, channel, max_duration, NULL);
+}
+
+/** \defgroup msg_gos_functions MSG Operating System Functions
+ * \brief This section describes the functions that can be used
+ * by an agent for handling some task.
+ */
+
+MSG_error_t
+MSG_task_get_ext(m_task_t * task, m_channel_t channel, double timeout,
+ m_host_t host)
+{
+ xbt_assert1((channel >= 0)
+ && (channel < msg_global->max_channel), "Invalid channel %d",
+ channel);
+
+ return
+ MSG_mailbox_get_task_ext(MSG_mailbox_get_by_channel
+ (MSG_host_self(), channel), task, host,
+ timeout);
+}
+
+MSG_error_t
+MSG_task_receive_from_host(m_task_t * task, const char *alias,
+ m_host_t host)
+{
+ return MSG_task_receive_ext(task, alias, -1, host);
+}
+
+MSG_error_t MSG_task_receive(m_task_t * task, const char *alias)
+{
+ return MSG_task_receive_with_timeout(task, alias, -1);
+}
+
+MSG_error_t
+MSG_task_receive_with_timeout(m_task_t * task, const char *alias,
+ double timeout)
+{
+ return MSG_task_receive_ext(task, alias, timeout, NULL);
+}
+
+MSG_error_t
+MSG_task_receive_ext(m_task_t * task, const char *alias, double timeout,
+ m_host_t host)
+{
+ DEBUG1
+ ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'",
+ alias);
+ return MSG_mailbox_get_task_ext(MSG_mailbox_get_by_alias(alias), task,
+ host, timeout);
+}
+
+/** \ingroup msg_gos_functions
+ * \brief Sends a task on a mailbox.
+ *
+ * This is a non blocking function: use MSG_comm_wait() or MSG_comm_test()
+ * to end the communication.
+ *
+ * \param task a #m_task_t to send on another location.
+ * \param alias name of the mailbox to sent the task to
+ * \return the msg_comm_t communication created
+ */
+msg_comm_t MSG_task_isend(m_task_t task, const char *alias)