private void InitTaskThreads(int threadNum, bool isPassive, int tickSleepTime, int actionNumPerTick)
 {
     if (isPassive)
     {
         m_ActionQueue = new ServerAsyncActionProcessor();
     }
     m_Threads = new MyServerThread[threadNum];
     for (int i = 0; i < threadNum; ++i)
     {
         MyServerThread thread = null;
         if (isPassive)
         {
             thread = new MyServerThread(tickSleepTime, actionNumPerTick, m_ActionQueue);//线程主动取策略
         }
         else
         {
             thread = new MyServerThread(tickSleepTime, actionNumPerTick);//dispatcher主动推策略
         }
         m_Threads[i] = thread;
         thread.Start();
     }
 }
Exemplo n.º 2
0
 internal DbThread(ServerAsyncActionProcessor actionQueue)
     : base(actionQueue)
 {
 }
Exemplo n.º 3
0
 public MyServerThread(int tickSleepTime, int actionNumPerTick, ServerAsyncActionProcessor asyncActionQueue)
 {
     m_TickSleepTime    = tickSleepTime;
     m_ActionNumPerTick = actionNumPerTick;
     InitThread(asyncActionQueue);
 }
Exemplo n.º 4
0
 public MyServerThread(int tickSleepTime, ServerAsyncActionProcessor asyncActionQueue)
 {
     m_TickSleepTime = tickSleepTime;
     InitThread(asyncActionQueue);
 }
Exemplo n.º 5
0
 private void InitThread(ServerAsyncActionProcessor asyncActionQueue)
 {
     m_Thread      = new Thread(this.Loop);
     m_ActionQueue = asyncActionQueue;
 }
Exemplo n.º 6
0
 public MyServerThread(ServerAsyncActionProcessor asyncActionQueue)
 {
     InitThread(asyncActionQueue);
 }