space_multi_thread_balance_quantity.cpp File Reference
#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"
Include dependency graph for space_multi_thread_balance_quantity.cpp:

Go to the source code of this file.

Classes

struct  argos::SCleanupUpdateThreadData
 

Namespaces

 argos
 The namespace containing all the ARGoS related code.
 

Macros

#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)
 

Macro Definition Documentation

#define MAIN_SEND_GO_FOR_PHASE (   PHASE)
Value:
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);
CARGoSLog LOG(std::cout, SLogColor(ARGOS_LOG_ATTRIBUTE_BRIGHT, ARGOS_LOG_COLOR_GREEN))
Definition: argos_log.h:179
CARGoSLog LOGERR(std::cerr, SLogColor(ARGOS_LOG_ATTRIBUTE_BRIGHT, ARGOS_LOG_COLOR_RED))
Definition: argos_log.h:180

Definition at line 168 of file space_multi_thread_balance_quantity.cpp.

#define MAIN_WAIT_FOR_PHASE_END (   PHASE)
Value:
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 176 of file space_multi_thread_balance_quantity.cpp.

#define THREAD_SIGNAL_PHASE_DONE (   PHASE)
Value:
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 235 of file space_multi_thread_balance_quantity.cpp.

#define THREAD_WAIT_FOR_GO_SIGNAL (   PHASE)
Value:
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 227 of file space_multi_thread_balance_quantity.cpp.