Last active
January 1, 2021 14:46
-
-
Save ierhalim/20290bf11d668d71a95d86f980ccd766 to your computer and use it in GitHub Desktop.
Y7O3 Paralel programlama
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace ParallelLinQExample | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; | |
| var filtered = numbers.AsParallel().AsOrdered().Where((number) => | |
| { | |
| Console.WriteLine("Current Number:{0}", number); | |
| return number > 5; | |
| }); | |
| Console.WriteLine("Before GetEnumarator."); | |
| // ToList metodu GetEnumerator metodunu çalıştırır. | |
| // Bkz: https://github.com/microsoft/referencesource/blob/master/System.Core/System/Linq/ParallelEnumerable.cs (Satır: 4907,4918,4922) | |
| // Bkz: https://referencesource.microsoft.com/#mscorlib/system/collections/generic/list.cs,61f6a8d9f0c40f6e (Satır: 98) | |
| List<int> filteredList = filtered.ToList(); | |
| Console.WriteLine("After GetEnumarator."); | |
| Console.ReadKey(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment