ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
#include <unistd.h>
#include <cstring>
#include <argos3/core/simulator/simulator.h>
#include <argos3/core/utility/profiler/profiler.h>
#include "space_multi_thread_balance_quantity.h"
Go to the source code of this file.
Classes | |
struct | argos::SCleanupUpdateThreadData |
Namespaces | |
namespace | argos |
The namespace containing all the ARGoS related code. | |
Defines | |
#define | MAIN_SEND_GO_FOR_PHASE(PHASE) |
#define | MAIN_WAIT_FOR_PHASE_END(PHASE) |
#define | THREAD_WAIT_FOR_GO_SIGNAL(PHASE) |
#define | THREAD_SIGNAL_PHASE_DONE(PHASE) |
Functions | |
void * | argos::LaunchUpdateThreadBalanceQuantity (void *p_data) |
CRange< size_t > | argos::CalculatePluginRangeForThread (size_t un_id, size_t un_tot_plugins) |
#define MAIN_SEND_GO_FOR_PHASE | ( | PHASE | ) |
LOG.Flush(); \ LOGERR.Flush(); \ pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \ m_un ## PHASE ## PhaseDoneCounter = 0; \ pthread_cond_broadcast(&m_t ## PHASE ## Conditional); \ pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex);
Definition at line 159 of file space_multi_thread_balance_quantity.cpp.
#define MAIN_WAIT_FOR_PHASE_END | ( | PHASE | ) |
pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \ while(m_un ## PHASE ## PhaseDoneCounter < CSimulator::GetInstance().GetNumThreads()) { \ pthread_cond_wait(&m_t ## PHASE ## Conditional, &m_t ## PHASE ## ConditionalMutex); \ } \ pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex);
Definition at line 167 of file space_multi_thread_balance_quantity.cpp.
#define THREAD_SIGNAL_PHASE_DONE | ( | PHASE | ) |
pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \ ++m_un ## PHASE ## PhaseDoneCounter; \ pthread_cond_broadcast(&m_t ## PHASE ## Conditional); \ pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex); \ pthread_testcancel();
Definition at line 218 of file space_multi_thread_balance_quantity.cpp.
#define THREAD_WAIT_FOR_GO_SIGNAL | ( | PHASE | ) |
pthread_mutex_lock(&m_t ## PHASE ## ConditionalMutex); \ while(m_un ## PHASE ## PhaseDoneCounter == CSimulator::GetInstance().GetNumThreads()) { \ pthread_cond_wait(&m_t ## PHASE ## Conditional, &m_t ## PHASE ## ConditionalMutex); \ } \ pthread_mutex_unlock(&m_t ## PHASE ## ConditionalMutex); \ pthread_testcancel();
Definition at line 210 of file space_multi_thread_balance_quantity.cpp.