|
SimGrid
3.17
Versatile Simulation of Distributed Systems
|
#include "smx_private.h"#include "src/surf/cpu_interface.hpp"#include "src/surf/surf_interface.hpp"#include <xbt/ex.hpp>#include <xbt/log.h>#include "src/kernel/activity/SynchroRaw.hpp"Namespaces | |
| simgrid | |
| Alltoall Bruck. | |
| simgrid::simix | |
Functions | |
| XBT_LOG_NEW_DEFAULT_SUBCATEGORY (simix_synchro, simix, "SIMIX Synchronization (mutex, semaphores and conditions)") | |
| static smx_activity_t | SIMIX_synchro_wait (sg_host_t smx_host, double timeout) |
| static void | _SIMIX_cond_wait (smx_cond_t cond, smx_mutex_t mutex, double timeout, smx_actor_t issuer, smx_simcall_t simcall) |
| static void | _SIMIX_sem_wait (smx_sem_t sem, double timeout, smx_actor_t issuer, smx_simcall_t simcall) |
| void | SIMIX_synchro_stop_waiting (smx_actor_t process, smx_simcall_t simcall) |
| void | SIMIX_synchro_finish (smx_activity_t synchro) |
| smx_mutex_t | SIMIX_mutex_ref (smx_mutex_t mutex) |
| Increase the refcount for this mutex. More... | |
| void | SIMIX_mutex_unref (smx_mutex_t mutex) |
| Decrease the refcount for this mutex. More... | |
| void | simcall_HANDLER_mutex_lock (smx_simcall_t simcall, smx_mutex_t mutex) |
| int | simcall_HANDLER_mutex_trylock (smx_simcall_t simcall, smx_mutex_t mutex) |
| void | simcall_HANDLER_mutex_unlock (smx_simcall_t simcall, smx_mutex_t mutex) |
| smx_cond_t | SIMIX_cond_init () |
| Initialize a condition. More... | |
| void | simcall_HANDLER_cond_wait (smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex) |
| Handle a condition waiting simcall without timeouts. More... | |
| void | simcall_HANDLER_cond_wait_timeout (smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout) |
| Handle a condition waiting simcall with timeouts. More... | |
| void | SIMIX_cond_signal (smx_cond_t cond) |
| Signalizes a condition. More... | |
| void | SIMIX_cond_broadcast (smx_cond_t cond) |
| Broadcasts a condition. More... | |
| smx_cond_t | SIMIX_cond_ref (smx_cond_t cond) |
| void | SIMIX_cond_unref (smx_cond_t cond) |
| void | intrusive_ptr_add_ref (s_smx_cond_t *cond) |
| void | intrusive_ptr_release (s_smx_cond_t *cond) |
| smx_sem_t | SIMIX_sem_init (unsigned int value) |
| Initialize a semaphore. More... | |
| void | SIMIX_sem_destroy (smx_sem_t sem) |
| Destroys a semaphore. More... | |
| void | SIMIX_sem_release (smx_sem_t sem) |
| release the semaphore More... | |
| int | SIMIX_sem_would_block (smx_sem_t sem) |
| Returns true if acquiring this semaphore would block. More... | |
| int | SIMIX_sem_get_capacity (smx_sem_t sem) |
| Returns the current capacity of the semaphore. More... | |
| void | simcall_HANDLER_sem_acquire (smx_simcall_t simcall, smx_sem_t sem) |
| Handles a sem acquire simcall without timeout. More... | |
| void | simcall_HANDLER_sem_acquire_timeout (smx_simcall_t simcall, smx_sem_t sem, double timeout) |
| Handles a sem acquire simcall with timeout. More... | |
| XBT_LOG_NEW_DEFAULT_SUBCATEGORY | ( | simix_synchro | , |
| simix | , | ||
| "SIMIX Synchronization (mutex, semaphores and conditions)" | |||
| ) |
|
static |
|
static |
|
static |
| void SIMIX_synchro_stop_waiting | ( | smx_actor_t | process, |
| smx_simcall_t | simcall | ||
| ) |
| void SIMIX_synchro_finish | ( | smx_activity_t | synchro | ) |
| smx_mutex_t SIMIX_mutex_ref | ( | smx_mutex_t | mutex | ) |
Increase the refcount for this mutex.
| void SIMIX_mutex_unref | ( | smx_mutex_t | mutex | ) |
Decrease the refcount for this mutex.
| void simcall_HANDLER_mutex_lock | ( | smx_simcall_t | simcall, |
| smx_mutex_t | mutex | ||
| ) |
| int simcall_HANDLER_mutex_trylock | ( | smx_simcall_t | simcall, |
| smx_mutex_t | mutex | ||
| ) |
| void simcall_HANDLER_mutex_unlock | ( | smx_simcall_t | simcall, |
| smx_mutex_t | mutex | ||
| ) |
| smx_cond_t SIMIX_cond_init | ( | ) |
Initialize a condition.
Allocates and creates the data for the condition. It have to be called before the use of the condition.
| void simcall_HANDLER_cond_wait | ( | smx_simcall_t | simcall, |
| smx_cond_t | cond, | ||
| smx_mutex_t | mutex | ||
| ) |
Handle a condition waiting simcall without timeouts.
| simcall | the simcall |
| void simcall_HANDLER_cond_wait_timeout | ( | smx_simcall_t | simcall, |
| smx_cond_t | cond, | ||
| smx_mutex_t | mutex, | ||
| double | timeout | ||
| ) |
Handle a condition waiting simcall with timeouts.
| simcall | the simcall |
| void SIMIX_cond_signal | ( | smx_cond_t | cond | ) |
Signalizes a condition.
Signalizes a condition and wakes up a sleeping process. If there are no process sleeping, no action is done.
| cond | A condition |
| void SIMIX_cond_broadcast | ( | smx_cond_t | cond | ) |
Broadcasts a condition.
Signal ALL processes waiting on a condition. If there are no process waiting, no action is done.
| cond | A condition |
| smx_cond_t SIMIX_cond_ref | ( | smx_cond_t | cond | ) |
| void SIMIX_cond_unref | ( | smx_cond_t | cond | ) |
| void intrusive_ptr_add_ref | ( | s_smx_cond_t * | cond | ) |
| void intrusive_ptr_release | ( | s_smx_cond_t * | cond | ) |
| smx_sem_t SIMIX_sem_init | ( | unsigned int | value | ) |
Initialize a semaphore.
release the semaphore
Unlock a process waiting on the semaphore. If no one was blocked, the semaphore capacity is increased by 1.
| int SIMIX_sem_would_block | ( | smx_sem_t | sem | ) |
Returns true if acquiring this semaphore would block.
| int SIMIX_sem_get_capacity | ( | smx_sem_t | sem | ) |
Returns the current capacity of the semaphore.
| void simcall_HANDLER_sem_acquire | ( | smx_simcall_t | simcall, |
| smx_sem_t | sem | ||
| ) |
Handles a sem acquire simcall without timeout.
| simcall | the simcall |
| void simcall_HANDLER_sem_acquire_timeout | ( | smx_simcall_t | simcall, |
| smx_sem_t | sem, | ||
| double | timeout | ||
| ) |
Handles a sem acquire simcall with timeout.
| simcall | the simcall |