SimGrid
3.14.159
Versatile Simulation of Distributed Systems
|
Classes | |
class | ActorImpl |
class | Future |
A blocking (wait() -based) future for SIMIX processes. More... | |
class | Global |
class | Host |
class | Mailbox |
Rendez-vous point datatype. More... | |
class | Mutex |
class | ProcessArg |
Typedefs | |
typedef std::function< void()> | ActorCode |
typedef std::function< ActorCode(std::vector< std::string > args)> | ActorCodeFactory |
Functions | |
void | unblock (smx_actor_t process) |
template<class F > | |
auto | kernelSync (F code) -> decltype(code().get()) |
Execute some code in kernel mode and wakes up the actor when the result is available. More... | |
template<class F > | |
auto | kernelAsync (F code) -> Future< decltype(code().get())> |
Start some asynchronous work. More... | |
template<class F > | |
std::result_of< F()>::type | kernelImmediate (F &&code) |
Execute some code in the kernel/maestro. More... | |
void | set_maestro (std::function< void()> code) |
void | create_maestro (std::function< void()> code) |
void | registerFunction (const char *name, ActorCodeFactory factory) |
Variables | |
simgrid::xbt::signal< void()> | onDeadlock |
These functions will be called when we detect a deadlock: any remaining process is locked on an action. More... | |
typedef std::function<void()> simgrid::simix::ActorCode |
typedef std::function<ActorCode(std::vector<std::string> args)> simgrid::simix::ActorCodeFactory |
void simgrid::simix::unblock | ( | smx_actor_t | process | ) |
auto simgrid::simix::kernelSync | ( | F | code | ) | -> decltype(code().get()) |
Execute some code in kernel mode and wakes up the actor when the result is available.
It is given a callback which is executed in the SimGrid kernel and returns a simgrid::kernel::Future<T>
. The kernel blocks the actor until the Future is ready and:
This can be used to implement blocking calls without adding new simcalls. One downside of this approach is that we don't have any semantic on what the actor is waiting. This might be a problem for the model-checker and we'll have to devise a way to make it work.
code | Kernel code returning a simgrid::kernel::Future<T> |
Exception | from the kernel future |
auto simgrid::simix::kernelAsync | ( | F | code | ) | -> Future<decltype(code().get())> |
Start some asynchronous work.
code | SimGrid kernel code which returns a simgrid::kernel::Future |
std::result_of<F()>::type simgrid::simix::kernelImmediate | ( | F && | code | ) |
Execute some code in the kernel/maestro.
This can be used to enforce mutual exclusion with other simcall. More importantly, this enforces a deterministic/reproducible ordering of the operation with respect to other simcalls.
void simgrid::simix::set_maestro | ( | std::function< void()> | code | ) |
void simgrid::simix::create_maestro | ( | std::function< void()> | code | ) |
void simgrid::simix::registerFunction | ( | const char * | name, |
ActorCodeFactory | factory | ||
) |
simgrid::xbt::signal< void()> simgrid::simix::onDeadlock |
These functions will be called when we detect a deadlock: any remaining process is locked on an action.
If these functions manage to unlock some of the processes, then the deadlock will be avoided.