示例#1
0
        //test for the bfs
        public void test3()
        {
            initQueuesTest2();
            DateTime    startTime      = DateTime.Now;
            BFSFrontier bfsFrontier    = new BFSFrontier(feedback, serverQueues);
            Thread      frontierThread = new Thread(new ThreadStart(bfsFrontier.sceduleTasks));

            frontierThread.Start();
            Thread workerThread = new Thread(new ThreadStart(workerSimulator2));

            workerThread.Start();

            int iteration = 5000;

            while (true)
            {
                Thread.Sleep(10);
                fillQueue(iteration, iteration + 5000);
                iteration += 5000;
                if (iteration > 50000)
                {
                    break;
                }
            }
            //frontierThread.Join();
            workerThread.Join();

            DateTime endTime   = DateTime.Now;
            TimeSpan totalTime = endTime - startTime;
        }
示例#2
0
        //test for the bfs
        public void test3()
        {
            initQueuesTest2();
            DateTime startTime = DateTime.Now;
            BFSFrontier bfsFrontier = new BFSFrontier(feedback, serverQueues);
            Thread frontierThread = new Thread(new ThreadStart(bfsFrontier.sceduleTasks));
            frontierThread.Start();
            Thread workerThread = new Thread(new ThreadStart(workerSimulator2));
            workerThread.Start();

            int iteration = 5000;
            while (true)
            {
                Thread.Sleep(10);
                fillQueue(iteration, iteration + 5000);
                iteration += 5000;
                if (iteration > 50000)
                    break;
            }
            //frontierThread.Join();
            workerThread.Join();

            DateTime endTime = DateTime.Now;
            TimeSpan totalTime = endTime - startTime;
        }