22 #if !defined(AFX_DG_THREADS_42YH_HY78GT_YHJ63Y__INCLUDED_) 23 #define AFX_DG_THREADS_42YH_HY78GT_YHJ63Y__INCLUDED_ 25 #define DG_MAXQUEUE 16 33 virtual void ThreadExecute() = 0;
36 dgInt32 m_threadIndex;
45 void CreateThreaded(dgInt32 threadCount);
46 void DestroydgThreads();
49 void SetPerfomanceCounter(OnGetPerformanceCountCallback callback);
50 dgUnsigned32 GetPerfomanceTicks(dgUnsigned32 threadIndex)
const;
52 dgInt32 GetThreadCount()
const ;
54 void SynchronizationBarrier();
55 void CalculateChunkSizes(dgInt32 elements, dgInt32 *
const chunkSizes)
const;
57 void dgGetLock()
const;
58 void dgReleaseLock()
const;
60 void dgGetIndirectLock(dgInt32 *lockVar);
61 void dgReleaseIndirectLock(dgInt32 *lockVar);
66 dgInt32 m_threadIndex;
70 void DoWork(dgInt32 threadIndex);
74 static void *ThreadExecute(
void *Param);
76 dgInt32 m_numOfThreads;
77 dgInt32 m_numberOfCPUCores;
79 dgInt32 m_bottomIndex;
80 dgInt32 m_workInProgress;
81 mutable dgInt32 m_globalSpinLock;
87 dgInt32 m_workToDoSpinLock;
91 OnGetPerformanceCountCallback m_getPerformanceCount;
92 dgLocadData m_localData[DG_MAXIMUN_THREADS];
Definition: dgThreads.h:28
Definition: dgThreads.h:40