コード例 #1
0
 internal void Init(int threadNum, int tickSleepTime, int actionNumPerTick)
 {
     m_ThreadNum = threadNum;
       for (int i = 0; i < threadNum; ++i) {
     NodeMessageThread thread = new NodeMessageThread(tickSleepTime, actionNumPerTick);
     m_NodeMessageThreads.Add(thread);
       }
 }
コード例 #2
0
 internal void Init(int threadNum, int tickSleepTime, int actionNumPerTick)
 {
     m_ThreadNum = threadNum;
     for (int i = 0; i < threadNum; ++i)
     {
         NodeMessageThread thread = new NodeMessageThread(tickSleepTime, actionNumPerTick);
         m_NodeMessageThreads.Add(thread);
     }
 }
コード例 #3
0
 internal void DispatchMessage(bool isGmTool, uint seq, int sourceHandle, int destHandle, byte[] data)
 {
     try {
         int index = Interlocked.Increment(ref m_TurnIndex) % m_ThreadNum;
         NodeMessageThread thread = m_NodeMessageThreads[index];
         thread.QueueMessage(isGmTool, seq, sourceHandle, destHandle, data);
     } catch (Exception ex) {
         LogSys.Log(LOG_TYPE.ERROR, "NodeMessageManager.DispatchMessage throw exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
コード例 #4
0
        internal void Stop()
        {
            int threadNum = m_NodeMessageThreads.Count;

            for (int i = 0; i < threadNum; ++i)
            {
                NodeMessageThread thread = m_NodeMessageThreads[i];
                thread.Stop();
            }
        }
コード例 #5
0
        internal void TickMonitor()
        {
            int threadNum = m_NodeMessageThreads.Count;

            for (int i = 0; i < threadNum; ++i)
            {
                NodeMessageThread thread = m_NodeMessageThreads[i];

                LogSys.Log(LOG_TYPE.INFO, "NodeMessageManager.ThreadMessagePool {0} buffered {1} messages", thread.Thread.ManagedThreadId, thread.PoolCount);

                LogSys.Log(LOG_TYPE.MONITOR, "NodeMessageManager.ThreadActionQueue ThreadActionCount {0} {1}", thread.Thread.ManagedThreadId, thread.CurActionNum);
            }
        }