Beispiel #1
0
        private void RunItem()
        {
            m_logger.debugLog("entered, high count: " + m_pathHigh.Count + ", low count: " + m_pathLow.Count + ", high parallel: " + Thread_High.ParallelTasks + ", low parallel: " + Thread_Low.ParallelTasks);

            Action act;

            if (m_pathHigh.TryDequeue(out act))
            {
                m_logger.debugLog("Adding item to Thread_High, count: " + (Thread_High.ParallelTasks + 1));
                Thread_High.EnqueueAction(act);
            }
            else if (m_pathLow.TryDequeue(out act))
            {
                m_logger.debugLog("Adding item to Thread_Low, count: " + (Thread_Low.ParallelTasks + 1));
                Thread_Low.EnqueueAction(act);
            }
        }
Beispiel #2
0
        private static void DoTest()
        {
            int  count  = 0;
            long cutoff = Timer.ElapsedTicks + CutOffAfter;

            while (Timer.ElapsedTicks < cutoff)
            {
                count++;
                Action test;
                if (DoTests.TryDequeue(out test))
                {
                    test.Invoke();
                }
                else
                {
                    return;
                }
            }
            s_logger.debugLog("tests: " + count);
        }