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

◆ MAIN_SEND_GO_FOR_PHASE

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

Definition at line 178 of file space_multi_thread_balance_quantity.cpp.

◆ MAIN_WAIT_FOR_PHASE_END

#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 186 of file space_multi_thread_balance_quantity.cpp.

◆ THREAD_SIGNAL_PHASE_DONE

#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 265 of file space_multi_thread_balance_quantity.cpp.

◆ THREAD_WAIT_FOR_GO_SIGNAL

#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 257 of file space_multi_thread_balance_quantity.cpp.