#include "space_multi_thread_balance_length.h"
#include <argos3/core/simulator/simulator.h>
#include <argos3/core/utility/profiler/profiler.h>
Go to the source code of this file.
Classes | |
struct | argos::SCleanupThreadData |
Namespaces | |
namespace | argos |
The namespace containing all the ARGoS related code. | |
Defines | |
#define | MAIN_START_PHASE(PHASE) |
#define | MAIN_WAIT_FOR_END_OF(PHASE) |
#define | THREAD_WAIT_FOR_START_OF(PHASE) |
#define | THREAD_PERFORM_TASK(PHASE, TASKVEC, SNIPPET) |
Functions | |
void * | argos::LaunchThreadBalanceLength (void *p_data) |
#define MAIN_START_PHASE | ( | PHASE | ) |
pthread_mutex_lock(&m_tStart ## PHASE ## PhaseMutex); \ m_un ## PHASE ## PhaseIdleCounter = 0; \ m_unTaskIndex = 0; \ pthread_cond_broadcast(&m_tStart ## PHASE ## PhaseCond); \ pthread_mutex_unlock(&m_tStart ## PHASE ## PhaseMutex);
Definition at line 156 of file space_multi_thread_balance_length.cpp.
#define MAIN_WAIT_FOR_END_OF | ( | PHASE | ) |
pthread_mutex_lock(&m_tStart ## PHASE ## PhaseMutex); \
while(m_un ## PHASE ## PhaseIdleCounter < CSimulator::GetInstance().GetNumThreads()) { \
pthread_cond_wait(&m_tStart ## PHASE ## PhaseCond, &m_tStart ## PHASE ## PhaseMutex); \
} \
pthread_mutex_unlock(&m_tStart ## PHASE ## PhaseMutex);
Definition at line 163 of file space_multi_thread_balance_length.cpp.
#define THREAD_PERFORM_TASK | ( | PHASE, | |||
TASKVEC, | |||||
SNIPPET | ) |
while(1) { \ pthread_mutex_lock(&m_tFetchTaskMutex); \ if(m_unTaskIndex < (TASKVEC).size()) { \ unTaskIndex = m_unTaskIndex; \ ++m_unTaskIndex; \ pthread_mutex_unlock(&m_tFetchTaskMutex); \ pthread_testcancel(); \ { \ SNIPPET; \ } \ pthread_testcancel(); \ } \ else { \ pthread_mutex_unlock(&m_tFetchTaskMutex); \ pthread_testcancel(); \ pthread_mutex_lock(&m_tStart ## PHASE ## PhaseMutex); \ ++m_un ## PHASE ## PhaseIdleCounter; \ pthread_cond_broadcast(&m_tStart ## PHASE ## PhaseCond); \ pthread_mutex_unlock(&m_tStart ## PHASE ## PhaseMutex); \ pthread_testcancel(); \ break; \ } \ } \ pthread_testcancel();
Definition at line 241 of file space_multi_thread_balance_length.cpp.
#define THREAD_WAIT_FOR_START_OF | ( | PHASE | ) |
pthread_mutex_lock(&m_tStart ## PHASE ## PhaseMutex); \
while(m_un ## PHASE ## PhaseIdleCounter == CSimulator::GetInstance().GetNumThreads()) { \
pthread_cond_wait(&m_tStart ## PHASE ## PhaseCond, &m_tStart ## PHASE ## PhaseMutex); \
} \
pthread_mutex_unlock(&m_tStart ## PHASE ## PhaseMutex); \
pthread_testcancel();
Definition at line 233 of file space_multi_thread_balance_length.cpp.