July 2015
Intermediate to advanced
1300 pages
87h 27m
English
To create a parallel query, you need to invoke the AsParallel extension method for the data source you want to query. Copy the method shown in the previous paragraph and rename it as PLinqQuery; then change the first line of the query as follows:
Dim query = From num In range.AsParallel
Different from a LINQ query, AsParallel returns a ParallelQuery(Of T) that is exposed by the System.Linq namespace and that is specific for PLINQ. However, it works as an IEnumerable(Of T) but enables you to scale data over multicore processors. Now edit Sub Main so that it invokes the PLinqQuery method and runs the code again. Figure 41.8 shows what you should see when the application is processing ...
Read now
Unlock full access