- simdata->mbox = xbt_new0(xbt_fifo_t, msg_global->max_channel);
- for (i = 0; i < msg_global->max_channel; i++)
- simdata->mbox[i] = xbt_fifo_new();
-
- simdata->sleeping = xbt_new0(smx_cond_t, msg_global->max_channel);
- simdata->mutex = SIMIX_mutex_init();
- SIMIX_host_set_data(workstation, host);
+ for (i = 0; i < msg_global->max_channel; i++) {
+ sprintf(alias, "%s:%d", name, i);
+
+ /* the key of the mailbox (in this case) is build from the name of the host and the channel number */
+ simdata->mailboxes[i] = MSG_mailbox_create(alias);
+ MSG_mailbox_set_hostname(simdata->mailboxes[i], name);
+ memset(alias, 0, MAX_ALIAS_NAME + 1);
+ }
+
+ simdata->mutex = SIMIX_mutex_init();
+ SIMIX_host_set_data(workstation, host);