クラス Onikiri::IcountFetchThreadSteerer

#include <IcountFetchThreadSteerer.h>

Onikiri::IcountFetchThreadSteererに対する継承グラフ

Inheritance graph
[凡例]
Onikiri::IcountFetchThreadSteererのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

Public メソッド

virtual void Finalize ()
 IcountFetchThreadSteerer ()
virtual void Initialize (InitPhase phase)
virtual ThreadSteerThread (bool update)
virtual ~IcountFetchThreadSteerer ()

説明

IcountFetchThreadSteerer.h44 行で定義されています。


コンストラクタとデストラクタ

IcountFetchThreadSteerer::IcountFetchThreadSteerer (  ) 

IcountFetchThreadSteerer.cpp43 行で定義されています。

00043                                                    :
00044     m_nextThread(0),
00045     m_evaluatedThread(0)
00046 {
00047 }

IcountFetchThreadSteerer::~IcountFetchThreadSteerer (  )  [virtual]

IcountFetchThreadSteerer.cpp49 行で定義されています。

00050 {
00051 }


関数

void IcountFetchThreadSteerer::Finalize (  )  [virtual]

Onikiri::PhysicalResourceNodeを再定義しています。

IcountFetchThreadSteerer.cpp66 行で定義されています。

参照先 Onikiri::PhysicalResourceNode::ReleaseParam().

00067 {
00068     ReleaseParam();
00069 }

関数の呼び出しグラフ:

void IcountFetchThreadSteerer::Initialize ( InitPhase  phase  )  [virtual]

IcountFetchThreadSteerer.cpp53 行で定義されています。

参照先 Onikiri::PhysicalResourceNode::CheckNodeInitialized()Onikiri::PhysicalResourceNode::INIT_POST_CONNECTIONOnikiri::PhysicalResourceNode::INIT_PRE_CONNECTIONOnikiri::ParamExchange::LoadParam().

00054 {
00055     if (phase == INIT_PRE_CONNECTION){
00056         LoadParam();
00057         return;
00058     }
00059     if (phase == INIT_POST_CONNECTION){
00060 
00061         CheckNodeInitialized( "thread", m_thread );
00062 
00063     }
00064 }

関数の呼び出しグラフ:

Thread * IcountFetchThreadSteerer::SteerThread ( bool  update  )  [virtual]

Onikiri::FetchThreadSteererIFを実装しています。

IcountFetchThreadSteerer.cpp71 行で定義されています。

00072 {
00073     int threadCount = m_thread.GetSize();
00074     std::vector<int> frontendInsnNum(threadCount,0);
00075 
00076     // Count the number of instructions in front-end for each thread.
00077     for (int tid = 0; tid < threadCount; tid++)
00078     {
00079         InorderList* inorderList = m_thread[tid]->GetInorderList();
00080         for (OpIterator op = inorderList->GetFrontOp(); op != OpIterator(0); op = inorderList->GetNextIndexOp(op))
00081         {
00082             if ( !op->IsDispatched() ||
00083                 (!op->GetOpClass().IsNop() && op->GetScheduler()->IsInScheduler(op)) )
00084             {
00085                 frontendInsnNum[tid]++;
00086             }
00087         }
00088     }
00089 
00090     // Find active thread
00091     int currentFetchThread = m_nextThread;
00092     int count = 0;
00093     bool found = true;
00094     while ( !m_thread[currentFetchThread]->IsActive() )
00095     {
00096         currentFetchThread = (currentFetchThread + 1) % threadCount;
00097         count++;
00098         if( count > threadCount ){
00099             found = false;
00100             break;
00101         }
00102     }
00103 
00104     if( !found ){
00105         if( update )
00106             m_nextThread = currentFetchThread;
00107         return NULL;
00108     }
00109 
00110     // Find a thread that has the smallest number of instructions in front-end.
00111     int targetThread = currentFetchThread;
00112     count = 0;
00113     do 
00114     {
00115         currentFetchThread = (currentFetchThread + 1) % threadCount;
00116         if (m_thread[currentFetchThread]->IsActive() && frontendInsnNum[targetThread] > frontendInsnNum[currentFetchThread])
00117         {
00118             targetThread = currentFetchThread;
00119         }
00120         count++;
00121     } while ( count <= threadCount );
00122 
00123     if( update ){
00124         if ( m_evaluatedThread != targetThread )
00125         {
00126             targetThread = m_evaluatedThread;
00127             m_nextThread = (targetThread + 1) % threadCount;
00128         }
00129         else
00130         {
00131             m_nextThread = (targetThread + 1) % threadCount;
00132         }
00133     }
00134     else
00135     {
00136         m_evaluatedThread = targetThread;
00137     }
00138 
00139     return m_thread[targetThread];
00140 }


このクラスの説明は次のファイルから生成されました:
Onikiri2に対してTue Jun 18 15:01:50 2013に生成されました。  doxygen 1.4.7