X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f9df6a0ce7023e4e22d83bb6c50f27bd21fab329..4eb7bc51e832299d593ccb590b54a2ac3a9590d6:/src/simix/smx_network_private.h diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 6cdbe6f0a6..51b017684d 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -7,19 +7,21 @@ #ifndef _SIMIX_NETWORK_PRIVATE_H #define _SIMIX_NETWORK_PRIVATE_H -#include #include #include +#include #include -#include +#include #include "simgrid/simix.h" #include "popping_private.h" #include "src/simix/ActorImpl.hpp" + +#define MAX_MAILBOX_SIZE 10000000 namespace simgrid { namespace simix { @@ -27,16 +29,16 @@ namespace simix { class Mailbox { public: - Mailbox(const char* name) : piface_(this), name(xbt_strdup(name)) {} + Mailbox(const char* name) : piface_(this), name(xbt_strdup(name)), comm_queue(MAX_MAILBOX_SIZE), done_comm_queue(MAX_MAILBOX_SIZE) {} ~Mailbox() { xbt_free(name); } simgrid::s4u::Mailbox piface_; // Our interface char* name; - std::deque comm_queue; + boost::circular_buffer_space_optimized comm_queue; boost::intrusive_ptr permanent_receiver; //process which the mailbox is attached to - std::deque done_comm_queue;//messages already received in the permanent receive mode + boost::circular_buffer_space_optimized done_comm_queue;//messages already received in the permanent receive mode }; } @@ -46,15 +48,15 @@ XBT_PRIVATE void SIMIX_mailbox_exit(); XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name); XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name); -XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm); +XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_activity_t comm); -XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc); -XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, +XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_actor_t proc); +XBT_PRIVATE smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, - int (*match_fun)(void *, void *, smx_synchro_t), - void (*copy_data_fun)(smx_synchro_t, void*, size_t), + int (*match_fun)(void *, void *, smx_activity_t), + void (*copy_data_fun)(smx_activity_t, void*, size_t), void *data, double rate); -XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src, - int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data); +XBT_PRIVATE smx_activity_t SIMIX_comm_iprobe(smx_actor_t dst_proc, smx_mailbox_t mbox, int type, int src, + int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data); #endif