Ex1Task1_StandardForEach()
End Sub
14. Build and run the application. Note: You should observe that the employees are once again processed in the order of the IDs. Also take note of the total amount of time required to complete this job (the exact time required will vary)
Figure 3 Output from non-parallel for…each implementation
15. To utilize the Parallel Extensions implementation of the for…each structure you’ll need to change the code to use the ForEach() method. In Program.cs (C#) or Module1.vb (Visual Basic)add the following method: (Code Snippet – Intro to Parallel Extensions Lab - Ex1 Ex1Task1_ParallelForEach CSharp) C#
|