Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement MSG_get_msgload
[simgrid.git] / src / msg / gos.c
index 9ae49b2..8ae5ab4 100644 (file)
@@ -64,7 +64,7 @@ MSG_error_t MSG_task_get(m_task_t * task,
 
   DEBUG2("Waiting for a task on channel %d (%s)", channel,h->name);
 
-  while ((t = xbt_fifo_pop(h_simdata->mbox[channel])) == NULL) {
+  while ((t = xbt_fifo_shift(h_simdata->mbox[channel])) == NULL) {
     xbt_assert2(!(h_simdata->sleeping[channel]),
                "A process (%s(%d)) is already blocked on this channel",
                h_simdata->sleeping[channel]->name,
@@ -377,9 +377,9 @@ MSG_error_t MSG_process_sleep(double nb_sec)
 int MSG_get_msgload(void) 
 {
   CHECK_HOST();
-  xbt_assert0(0,"Not implemented yet!");
   
-  return 1;
+  m_process_t process = MSG_process_self();
+  return xbt_fifo_size(process->simdata->host->simdata->process_list);
 }
 
 /** \ingroup msg_gos_functions