Пример #1
0
        private double[] _results;  // global place to store the workload results for verication

        #endregion

        public ParallelInvokeTest(ParallelInvokeTestParameters parameters)
        {
            _count = parameters.Count;
            _actionType = parameters.ActionType;

            _actions = new Action[_count];
            _results = new double[_count];

            // intialize actions 
            for (int i = 0; i < _count; i++)
            {
                int iCopy = i;
                if (_actionType == ActionType.Empty)
                {
                    _actions[i] = new Action(delegate { });
                }
                else if (_actionType == ActionType.EqualWorkload)
                {
                    _actions[i] = new Action(delegate
                    {
                        _results[iCopy] = ZetaSequence(SEED);
                    });
                }
                else
                {
                    _actions[i] = new Action(delegate
                    {
                        _results[iCopy] = ZetaSequence((iCopy + 1) * SEED);
                    });
                }
            }
        }
Пример #2
0
        private double[] _results;  // global place to store the workload results for verication

        #endregion

        public ParallelInvokeTest(ParallelInvokeTestParameters parameters)
        {
            _count      = parameters.Count;
            _actionType = parameters.ActionType;

            _actions = new Action[_count];
            _results = new double[_count];

            // intialize actions
            for (int i = 0; i < _count; i++)
            {
                int iCopy = i;
                if (_actionType == ActionType.Empty)
                {
                    _actions[i] = new Action(delegate { });
                }
                else if (_actionType == ActionType.EqualWorkload)
                {
                    _actions[i] = new Action(delegate
                    {
                        _results[iCopy] = ZetaSequence(SEED);
                    });
                }
                else
                {
                    _actions[i] = new Action(delegate
                    {
                        _results[iCopy] = ZetaSequence((iCopy + 1) * SEED);
                    });
                }
            }
        }
Пример #3
0
        public static void ParallelInvoke11()
        {
            ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters
            {
                Count      = 97,
                ActionType = ActionType.EqualWorkload,
            };
            ParallelInvokeTest test = new ParallelInvokeTest(parameters);

            test.RealRun();
        }
Пример #4
0
        public static void ParallelInvoke7()
        {
            ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters
            {
                Count      = 97,
                ActionType = ActionType.Empty,
            };
            ParallelInvokeTest test = new ParallelInvokeTest(parameters);

            test.RealRun();
        }
Пример #5
0
        public static void ParallelInvoke2()
        {
            ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters
            {
                Count      = 10,
                ActionType = ActionType.DifferentWorkload,
            };
            ParallelInvokeTest test = new ParallelInvokeTest(parameters);

            test.RealRun();
        }
Пример #6
0
 public static void ParallelInvoke11()
 {
     ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters
     {
         Count = 97,
         ActionType = ActionType.EqualWorkload,
     };
     ParallelInvokeTest test = new ParallelInvokeTest(parameters);
     test.RealRun();
 }
Пример #7
0
 public static void ParallelInvoke7()
 {
     ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters
     {
         Count = 97,
         ActionType = ActionType.Empty,
     };
     ParallelInvokeTest test = new ParallelInvokeTest(parameters);
     test.RealRun();
 }
Пример #8
0
 public static void ParallelInvoke2()
 {
     ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters
     {
         Count = 10,
         ActionType = ActionType.DifferentWorkload,
     };
     ParallelInvokeTest test = new ParallelInvokeTest(parameters);
     test.RealRun();
 }