コード例 #1
0
        [MemberData(nameof(WithExecutionModeQueryData), new int[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel
        public static void WithExecutionMode(
            Labeled <ParallelQuery <int> > labeled,
            int requestedDop, int expectedDop,
            Labeled <Action <UsedTaskTracker, ParallelQuery <int> > > operation,
            ParallelExecutionMode mode)
        {
            UsedTaskTracker tracker = new UsedTaskTracker();

            operation.Item(tracker, labeled.Item.WithDegreeOfParallelism(requestedDop).WithExecutionMode(mode));
            Assert.Equal(expectedDop, tracker.UniqueTasksCount);
        }
コード例 #2
0
ファイル: PlinqModesTests.cs プロジェクト: jmhardison/corefx
 [MemberData("WithExecutionModeQueryData", new int[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel
 public static void WithExecutionMode(
     Labeled<ParallelQuery<int>> labeled, 
     int requestedDop, int expectedDop,
     Labeled<Action<UsedTaskTracker, ParallelQuery<int>>> operation, 
     ParallelExecutionMode mode)
 {
     UsedTaskTracker tracker = new UsedTaskTracker();
     operation.Item(tracker, labeled.Item.WithDegreeOfParallelism(requestedDop).WithExecutionMode(mode));
     Assert.Equal(expectedDop, tracker.UniqueTasksCount);
 }