XBT_PUBLIC_CLASS Actor {
friend Mailbox;
friend simgrid::simix::ActorImpl;
- friend simgrid::simix::MailboxImpl;
+ friend simgrid::kernel::activity::MailboxImpl;
simix::ActorImpl* pimpl_ = nullptr;
/** Wrap a (possibly non-copyable) single-use task into a `std::function` */
XBT_PUBLIC_CLASS Mailbox {
friend Comm;
friend simgrid::s4u::Engine;
- friend simgrid::simix::MailboxImpl;
+ friend simgrid::kernel::activity::MailboxImpl;
- simgrid::simix::MailboxImpl* pimpl_;
+ simgrid::kernel::activity::MailboxImpl* pimpl_;
- explicit Mailbox(simix::MailboxImpl * mbox) : pimpl_(mbox) {}
+ explicit Mailbox(kernel::activity::MailboxImpl * mbox) : pimpl_(mbox) {}
/** private function to manage the mailboxes' lifetime (see @ref s4u_raii) */
friend void intrusive_ptr_add_ref(Mailbox*) {}
friend void intrusive_ptr_release(Mailbox*) {}
public:
/** private function, do not use. FIXME: make me protected */
- simix::MailboxImpl* getImpl() { return pimpl_; }
+ kernel::activity::MailboxImpl* getImpl() { return pimpl_; }
/** Gets the name of that mailbox */
const char *name();
namespace context {
class Context;
class ContextFactory;
-}}
+ }
+ namespace activity {
+ class MailboxImpl;
+ }
+ }
-namespace simix {
+ namespace simix {
/** @brief Process datatype
@ingroup simix_process_management
@{ */
class ActorImpl;
class Mutex;
- class MailboxImpl;
}
}
typedef simgrid::kernel::context::Context *smx_context_t;
typedef simgrid::simix::ActorImpl *smx_actor_t;
typedef simgrid::simix::Mutex *smx_mutex_t;
-typedef simgrid::simix::MailboxImpl* smx_mailbox_t;
+typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
#else
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "src/simix/MailboxImpl.hpp"
+#include "src/kernel/activity/MailboxImpl.hpp"
#include "src/kernel/activity/SynchroComm.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_mailbox, simix, "Mailbox implementation");
/******************************************************************************/
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
/** @brief Returns the mailbox of that name, or nullptr */
MailboxImpl* MailboxImpl::byNameOrNull(const char* name)
{
/* two processes may have pushed the same mbox_create simcall at the same time */
smx_mailbox_t mbox = static_cast<smx_mailbox_t>(xbt_dict_get_or_null(mailboxes, name));
if (!mbox) {
- mbox = new simgrid::simix::MailboxImpl(name);
+ mbox = new MailboxImpl(name);
XBT_DEBUG("Creating a mailbox at %p with name %s", mbox, name);
xbt_dict_set(mailboxes, mbox->name_, mbox, nullptr);
}
}
}
}
+}
#define MAX_MAILBOX_SIZE 10000000
namespace simgrid {
-namespace simix {
+namespace kernel {
+namespace activity {
-/** @brief Rendez-vous point datatype */
+/** @brief Implementation of the simgrid::s4u::Mailbox */
class MailboxImpl {
explicit MailboxImpl(const char* name)
simgrid::s4u::Mailbox piface_; // Our interface
char* name_;
- boost::intrusive_ptr<simgrid::simix::ActorImpl> permanent_receiver; //process which the mailbox is attached to
+ boost::intrusive_ptr<simgrid::simix::ActorImpl> permanent_receiver; // process which the mailbox is attached to
boost::circular_buffer_space_optimized<smx_activity_t> comm_queue;
- boost::circular_buffer_space_optimized<smx_activity_t> done_comm_queue;//messages already received in the permanent receive mode
+ boost::circular_buffer_space_optimized<smx_activity_t> done_comm_queue; // messages already received in the permanent receive mode
};
}
}
+}
XBT_PRIVATE void SIMIX_mailbox_exit();
MailboxPtr Mailbox::byName(const char*name)
{
- simix::MailboxImpl* mbox = simix::MailboxImpl::byNameOrNull(name);
+ kernel::activity::MailboxImpl* mbox = kernel::activity::MailboxImpl::byNameOrNull(name);
if (mbox == nullptr) {
mbox = simix::kernelImmediate([name] {
- return simix::MailboxImpl::byNameOrCreate(name);
+ return kernel::activity::MailboxImpl::byNameOrCreate(name);
});
}
return MailboxPtr(&mbox->piface_, true);
#define _SIMIX_NETWORK_PRIVATE_H
#include "simgrid/s4u/Mailbox.hpp"
+#include "src/kernel/activity/MailboxImpl.hpp"
#include "src/simix/ActorImpl.hpp"
-#include "src/simix/MailboxImpl.hpp"
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,
src/simix/smx_network.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
- src/simix/MailboxImpl.cpp
- src/simix/MailboxImpl.hpp
src/simix/smx_synchro.cpp
src/simix/popping.cpp
src/kernel/activity/ActivityImpl.cpp
+ src/kernel/activity/MailboxImpl.cpp
+ src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/SynchroComm.cpp
src/kernel/activity/SynchroExec.cpp
src/kernel/activity/SynchroSleep.cpp