Parallel LINQ Introduction
暂无分享,去创建一个
Back in Chapter 3, we opened with a simple LINQ to Objects example that found the first U.S. president whose name begins with Lin. Go on, take a look—we’ll wait for you. Now take a look at Listing 21-1, which is the same query but performed using Parallel LINQ. We have made it easier to spot the difference by highlighting the change—the new call to the As Parallel method. As you will learn, the query in Listing 22-1 isn’t very well suited to Parallel LINQ, but it does work, and it shows an important point, namely, that moving from a regular LINQ query to a Parallel LINQ query can be as easy as calling the As Parallel method.