├── LICENSE.txt ├── 9781430229674.jpg ├── SourceCode - Final ├── ParallelScratch │ ├── ParallelScratch.suo │ ├── linqparttest │ │ ├── Properties │ │ │ └── .svn │ │ │ │ ├── all-wcprops │ │ │ │ └── entries │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── text-base │ │ │ │ └── Program.cs.svn-base │ │ │ └── entries │ │ └── Program.cs │ ├── ParallelScratch.sln │ └── asparallel │ │ └── Properties │ │ └── AssemblyInfo.cs ├── 03 - Sharing Data │ ├── 03 - Sharing Data.suo │ ├── Listing_22 │ │ ├── Listing_22.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_02 │ │ ├── Listing_02.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_08 │ │ ├── Listing_08.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_01 │ │ ├── Listing_01.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_13 │ │ ├── Listing_13.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_03 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_04 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_05 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_06 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_07 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_09 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_10 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_11 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_12 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_14 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_15 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_16 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_17 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_18 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_19 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_20 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_21 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Listing_23 │ │ └── Properties │ │ └── AssemblyInfo.cs ├── 05 - Parallel Loops │ ├── 05 - Parallel Loops.suo │ ├── Listing_03 │ │ ├── Listing_03.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_05 │ │ ├── Listing_05.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Loop_Body_Data_Races │ │ └── Loop_Body_Data_Races.cs │ ├── Listing_11 │ │ ├── Listing_11.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_04 │ │ ├── Listing_04.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_07 │ │ ├── Listing_07.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_01 │ │ ├── Listing_01.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Synchronization_in_Loop_Bodies │ │ └── Synchronization_in_Loop_Bodies.cs │ ├── Using_Standard_Collections │ │ └── Using_Standard_Collections.cs │ ├── Listing_09 │ │ ├── Listing_09.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_08 │ │ ├── Listing_08.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_15 │ │ ├── Listing_15.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Using_Changing_Data │ │ └── Using_Changing_Data.cs │ ├── Listing_06 │ │ ├── Listing_06.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_14 │ │ ├── Listing_14.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_02 │ │ ├── Listing_02.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_16 │ │ ├── Listing_16.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_12 │ │ ├── Listing_12.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_10 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_13 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Listing_26 │ │ └── Properties │ │ └── AssemblyInfo.cs ├── 06 - Parallel LINQ │ ├── 06 - Parallel LINQ.suo │ ├── Listing_08 │ │ ├── Listing_08.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Sequential_Filtering │ │ └── Sequential_Filtering.cs │ ├── Listing_01 │ │ ├── Listing_01.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_20 │ │ ├── Listing_20.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Creating_Race_Conditions │ │ └── Creating_Race_Conditions.cs │ ├── Listing_05 │ │ ├── Listing_05.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_12 │ │ ├── Listing_12.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_11 │ │ ├── Listing_11.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Confusing_Ordering │ │ └── Confusing_Ordering.cs │ ├── Listing_13 │ │ ├── Listing_13.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_07 │ │ ├── Listing_07.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_16 │ │ ├── Listing_16.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_19 │ │ ├── Listing_19.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_03 │ │ ├── Listing_03.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_02 │ │ ├── Listing_02.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_09 │ │ ├── Listing_09.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_10 │ │ ├── Listing_10.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_04 │ │ ├── Listing_04.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_14 │ │ ├── Listing_14.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Listing_06 │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Listing_15 │ │ └── Properties │ │ └── AssemblyInfo.cs ├── 02 - Task Programming │ ├── 02 - Task Programming.suo │ ├── Listing_01 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_01.cs │ ├── Listing_02 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_02.cs │ ├── Listing_03 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_03.cs │ ├── Listing_04 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_04.cs │ ├── Listing_05 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_05.cs │ ├── Listing_06 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_06.cs │ ├── Listing_07 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_08 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_09 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_10 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_11 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_12 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_13 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_14 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_14.cs │ ├── Listing_15 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_15.cs │ ├── Listing_16 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_17 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_18 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_19 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_20 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_21 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_22 │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Listing_23 │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Listing_23.cs │ ├── Dependency_Deadlock │ │ ├── obj │ │ │ └── x86 │ │ │ │ └── Debug │ │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Dependency_Deadlock.cs │ ├── Excessive_Spinning │ │ └── obj │ │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ └── Local_Variable_Evaluation │ │ ├── obj │ │ └── x86 │ │ │ └── Debug │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Local_Variable_Evaluation.cs ├── 08 - Common Algorithms │ ├── 08 - Common Algorithms.suo │ ├── Parallel_Map │ │ ├── Parallel_Map.cs │ │ └── Use_Parallel_Map.cs │ ├── Parallel_Reduce │ │ ├── Parallel_Reduce.cs │ │ └── Use_Parallel_Reduce.cs │ ├── Decoupled_Console │ │ ├── Using_Decoupled_Console.cs │ │ └── Decoupled_Console.cs │ ├── Parallel_Cache │ │ ├── Parallel_Cache.cs │ │ └── Use_Parallel_Cache.cs │ ├── Parallel_MapReduce │ │ └── Parallel_MapReduce.cs │ ├── Parallel Sort │ │ └── Use_Parallel_Sort.cs │ ├── Speculative_Cache │ │ └── Use_Speculative_Cache.cs │ ├── Parallel_Tree_Traverse │ │ ├── Parallel_Tree_Traverse.cs │ │ └── Use_Parallel_Tree_Traverse.cs │ ├── Parallel_Tree_Search │ │ └── Use_Parallel_Tree_Search.cs │ ├── Pipeline │ │ ├── Use_Pipeline.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── Speculative_Selection │ │ └── Use_Speculative_Selection.cs ├── 04 - Coordinating Tasks │ ├── 04 - Coordinating Tasks.suo │ ├── Listing_01 │ │ └── Listing_01.cs │ ├── Listing_10 │ │ └── Listing_10.cs │ ├── Listing_08 │ │ └── Listing_08.cs │ ├── Trying_To_Take_Concurrently │ │ └── Trying_To_Take_Concurrently.cs │ ├── Listing_02 │ │ └── Listing_02.cs │ ├── Listing_04 │ │ └── Listing_04.cs │ └── Listing_13 │ │ └── Listing_13.cs └── 07 - Testing and Debugging │ ├── 07 - Testing and Debugging.suo │ ├── Listing_01 │ └── Listing_01.cs │ ├── Listing_03 │ └── Listing_03.cs │ ├── Listing_05 │ └── Listing_05.cs │ └── Listing_06 │ └── Listing_06.cs ├── README.md └── contributing.md /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/LICENSE.txt -------------------------------------------------------------------------------- /9781430229674.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/9781430229674.jpg -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/ParallelScratch.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/ParallelScratch/ParallelScratch.suo -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/03 - Sharing Data.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/03 - Sharing Data/03 - Sharing Data.suo -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/05 - Parallel Loops.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/05 - Parallel Loops/05 - Parallel Loops.suo -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/06 - Parallel LINQ.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/06 - Parallel LINQ/06 - Parallel LINQ.suo -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/02 - Task Programming.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/02 - Task Programming.suo -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/08 - Common Algorithms.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/08 - Common Algorithms/08 - Common Algorithms.suo -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/04 - Coordinating Tasks.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/04 - Coordinating Tasks/04 - Coordinating Tasks.suo -------------------------------------------------------------------------------- /SourceCode - Final/07 - Testing and Debugging/07 - Testing and Debugging.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/07 - Testing and Debugging/07 - Testing and Debugging.suo -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_01/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_01/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_02/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_02/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_03/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_03/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_04/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_04/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_05/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_05/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_06/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_06/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_07/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_07/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_08/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_08/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_09/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_09/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_10/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_10/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_11/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_11/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_12/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_12/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_13/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_13/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_14/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_14/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_15/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_15/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_16/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_16/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_17/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_17/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_18/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_18/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_19/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_19/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_20/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_20/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_21/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_21/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_22/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_22/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_23/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Listing_23/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Dependency_Deadlock/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Dependency_Deadlock/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Excessive_Spinning/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Excessive_Spinning/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Local_Variable_Evaluation/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pro-.net-4-parallel-programming-in-csharp/HEAD/SourceCode - Final/02 - Task Programming/Local_Variable_Evaluation/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/linqparttest/Properties/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 80 4 | /svn/ParallelBook/!svn/ver/29/SourceCode/ParallelScratch/linqparttest/Properties 5 | END 6 | AssemblyInfo.cs 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 96 10 | /svn/ParallelBook/!svn/ver/29/SourceCode/ParallelScratch/linqparttest/Properties/AssemblyInfo.cs 11 | END 12 | -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/linqparttest/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 69 4 | /svn/ParallelBook/!svn/ver/29/SourceCode/ParallelScratch/linqparttest 5 | END 6 | linqparttest.csproj 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 89 10 | /svn/ParallelBook/!svn/ver/29/SourceCode/ParallelScratch/linqparttest/linqparttest.csproj 11 | END 12 | Program.cs 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 80 16 | /svn/ParallelBook/!svn/ver/29/SourceCode/ParallelScratch/linqparttest/Program.cs 17 | END 18 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_01/Listing_01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_01 { 5 | 6 | class Listing_01 { 7 | 8 | static void Main(string[] args) { 9 | 10 | Task.Factory.StartNew(() => { 11 | Console.WriteLine("Hello World"); 12 | }); 13 | 14 | // wait for input before exiting 15 | Console.WriteLine("Main method complete. Press enter to finish."); 16 | Console.ReadLine(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Map/Parallel_Map.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Parallel_Map { 5 | 6 | class Parallel_Map { 7 | 8 | public static TOutput[] ParallelMap( 9 | Func mapFunction, 10 | TInput[] input) { 11 | 12 | return input 13 | .AsParallel() 14 | .AsOrdered() 15 | .Select(value => mapFunction(value)) 16 | .ToArray(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apress Source Code 2 | 3 | This repository accompanies [*Pro .NET 4 Parallel Programming in C#*](http://www.apress.com/9781430229674) by Adam Freeman (Apress, 2010). 4 | 5 | ![Cover image](9781430229674.jpg) 6 | 7 | Download the files as a zip using the green button, or clone the repository to your machine using Git. 8 | 9 | ## Releases 10 | 11 | Release v1.0 corresponds to the code in the published book, without corrections or updates. 12 | 13 | ## Contributions 14 | 15 | See the file Contributing.md for more information on how you can contribute to this repository. 16 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_03/Listing_03.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_03 { 5 | 6 | class Listing_03 { 7 | 8 | static void Main(string[] args) { 9 | 10 | Parallel.For(0, 10, index => { 11 | Console.WriteLine("Task ID {0} processing index: {1}", 12 | Task.CurrentId, index); 13 | }); 14 | 15 | // wait for input before exiting 16 | Console.WriteLine("Press enter to finish"); 17 | Console.ReadLine(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/linqparttest/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace linqparttest { 9 | class Program { 10 | static void Main(string[] args) { 11 | 12 | int[] dataArray = new int[107]; 13 | for (int i = 0; i < dataArray.Length; i++) { 14 | dataArray[i] = i; 15 | } 16 | 17 | List list = new List() {"hello", "world"}; 18 | 19 | 20 | 21 | 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/linqparttest/.svn/text-base/Program.cs.svn-base: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace linqparttest { 9 | class Program { 10 | static void Main(string[] args) { 11 | 12 | int[] dataArray = new int[107]; 13 | for (int i = 0; i < dataArray.Length; i++) { 14 | dataArray[i] = i; 15 | } 16 | 17 | List list = new List() {"hello", "world"}; 18 | 19 | 20 | 21 | 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SourceCode - Final/07 - Testing and Debugging/Listing_01/Listing_01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using System.Diagnostics; 4 | 5 | namespace Listing_01 { 6 | class Listing_01 { 7 | static void Main(string[] args) { 8 | 9 | Task[] tasks = new Task[2]; 10 | 11 | tasks[0] = Task.Factory.StartNew(() => { 12 | tasks[1].Wait(); 13 | }); 14 | 15 | tasks[1] = Task.Factory.StartNew(() => { 16 | tasks[0].Wait(); 17 | }); 18 | 19 | Console.WriteLine("Waiting for tasks to complete."); 20 | Task.WaitAll(tasks); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to Apress Source Code 2 | 3 | Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. 4 | 5 | ## How to Contribute 6 | 7 | 1. Make sure you have a GitHub account. 8 | 2. Fork the repository for the relevant book. 9 | 3. Create a new branch on which to make your change, e.g. 10 | `git checkout -b my_code_contribution` 11 | 4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. 12 | 5. Submit a pull request. 13 | 14 | Thank you for your contribution! -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/linqparttest/Properties/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 60 5 | http://svn.xp-dev.com/svn/ParallelBook/SourceCode/ParallelScratch/linqparttest/Properties 6 | http://svn.xp-dev.com/svn/ParallelBook 7 | 8 | 9 | 10 | 2010-01-16T15:23:22.160504Z 11 | 29 12 | adamfreeman 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | be42883c-59a8-464b-b0f1-b6c691c3a0dc 28 | 29 | AssemblyInfo.cs 30 | file 31 | 32 | 33 | 34 | 35 | 2010-01-11T12:57:49.872715Z 36 | 7aed799fe21dd0568c89e416cf88fd5f 37 | 2010-01-16T15:23:22.160504Z 38 | 29 39 | adamfreeman 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1454 62 | 63 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Reduce/Parallel_Reduce.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Parallel_Reduce { 5 | 6 | class Parallel_Reduce { 7 | 8 | public static TValue Reduce( 9 | TValue[] sourceData, 10 | TValue seedValue, 11 | Func reduceFunction) { 12 | 13 | // perform the reduction 14 | return sourceData 15 | .AsParallel() 16 | .Aggregate( 17 | seedValue, 18 | (localResult, value) => reduceFunction(localResult, value), 19 | (overallResult, localResult) => reduceFunction(overallResult, localResult), 20 | overallResult => overallResult); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Decoupled_Console/Using_Decoupled_Console.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Decoupled_Console { 5 | class Using_Decoupled_Console { 6 | 7 | static void Main(string[] args) { 8 | // create a set of tasks that each writes messages 9 | for (int i = 0; i < 10; i++) { 10 | Task.Factory.StartNew(state => { 11 | for (int j = 0; j < 10; j++) { 12 | Decoupled_Console.WriteLine("Message from task {0}", Task.CurrentId); 13 | } 14 | }, i); 15 | } 16 | 17 | // wait for input before exiting 18 | Console.WriteLine("Press enter to finish"); 19 | Console.ReadLine(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Cache/Parallel_Cache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | 4 | namespace Parallel_Cache { 5 | 6 | class Parallel_Cache { 7 | private ConcurrentDictionary> dictionary; 8 | private Func valueFactory; 9 | 10 | public Parallel_Cache(Func factory) { 11 | // set the factory instance variable 12 | valueFactory = factory; 13 | // initialize the dictionary 14 | dictionary = new ConcurrentDictionary>(); 15 | } 16 | 17 | public TValue GetValue(TKey key) { 18 | return dictionary.GetOrAdd(key, 19 | new Lazy(() => valueFactory(key))).Value; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_06/Listing_06.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_06 { 5 | 6 | class Listing_06 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create the task 11 | Task task1 = Task.Factory.StartNew(() => { 12 | int sum = 0; 13 | for (int i = 0; i < 100; i++) { 14 | sum += i; 15 | } 16 | return sum; 17 | }); 18 | 19 | // write out the result 20 | Console.WriteLine("Result 1: {0}", task1.Result); 21 | 22 | // wait for input before exiting 23 | Console.WriteLine("Main method complete. Press enter to finish."); 24 | Console.ReadLine(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_05/Listing_05.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_05 { 6 | class Listing_05 { 7 | 8 | static IEnumerable SteppedIterator(int startIndex, 9 | int endEndex, int stepSize) { 10 | for (int i = startIndex; i < endEndex; i += stepSize) { 11 | yield return i; 12 | } 13 | } 14 | 15 | static void Main(string[] args) { 16 | 17 | Parallel.ForEach(SteppedIterator(0, 10, 2), index => { 18 | Console.WriteLine("Index value: {0}", index); 19 | }); 20 | 21 | // wait for input before exiting 22 | Console.WriteLine("Press enter to finish"); 23 | Console.ReadLine(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Loop_Body_Data_Races/Loop_Body_Data_Races.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Loop_Body_Data_Races { 5 | class Loop_Body_Data_Races { 6 | static void Main(string[] args) { 7 | 8 | // create the shared data value 9 | double total = 0; 10 | 11 | // perform a parallel loop 12 | Parallel.For( 13 | 0, 14 | 100000, 15 | item => { 16 | // add the square of the current 17 | // value to the running total 18 | total += Math.Pow(item, 2); 19 | }); 20 | 21 | Console.WriteLine("Expected result: 333328333350000"); 22 | Console.WriteLine("Actual result: {0}", total); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_08/Listing_08.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Listing_08 { 5 | class Listing_08 { 6 | static void Main(string[] args) { 7 | 8 | // create some source data 9 | int[] sourceData = new int[50]; 10 | for (int i = 0; i < sourceData.Length; i++) { 11 | sourceData[i] = i; 12 | } 13 | 14 | // filter the data and call ForAll() 15 | sourceData.AsParallel() 16 | .Where(item => item % 2 == 0) 17 | .ForAll(item => Console.WriteLine("Item {0} Result {1}", 18 | item, Math.Pow(item, 2))); 19 | 20 | // wait for input before exiting 21 | Console.WriteLine("Press enter to finish"); 22 | Console.ReadLine(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_11/Listing_11.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_11 { 6 | class Listing_11 { 7 | static void Main(string[] args) { 8 | 9 | int total = 0; 10 | 11 | Parallel.For( 12 | 0, 13 | 100, 14 | () => 0, 15 | (int index, ParallelLoopState loopState, int tlsValue) => { 16 | tlsValue += index; 17 | return tlsValue; 18 | }, 19 | value => Interlocked.Add(ref total, value)); 20 | 21 | Console.WriteLine("Total: {0}", total); 22 | 23 | // wait for input before exiting 24 | Console.WriteLine("Press enter to finish"); 25 | Console.ReadLine(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Sequential_Filtering/Sequential_Filtering.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Sequential_Filtering { 5 | class Sequential_Filtering { 6 | static void Main(string[] args) { 7 | 8 | // create some source data 9 | int[] source1 = new int[100]; 10 | for (int i = 0; i < source1.Length; i++) { 11 | source1[i] = i; 12 | } 13 | 14 | // perform the query - but note 15 | // where the AsParallel call is 16 | var result = source1 17 | .Where(item => item % 2 == 0) 18 | .AsParallel() 19 | .Select(item => item); 20 | 21 | // wait for input before exiting 22 | Console.WriteLine("Press enter to finish"); 23 | Console.ReadLine(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_MapReduce/Parallel_MapReduce.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Parallel_MapReduce { 6 | class Parallel_MapReduce { 7 | 8 | public static IEnumerable 9 | MapReduce( 10 | IEnumerable sourceData, 11 | Func> mapFunction, 12 | Func groupFunction, 13 | Func, TOutput> reduceFunction) { 14 | 15 | return sourceData 16 | .AsParallel() 17 | .SelectMany(mapFunction) 18 | .GroupBy(groupFunction) 19 | .Select(reduceFunction); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_01/Listing_01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_01 { 6 | class Listing_01 { 7 | static void Main(string[] args) { 8 | 9 | int[] sourceData = new int[100]; 10 | for (int i = 0; i < sourceData.Length; i++) { 11 | sourceData[i] = i; 12 | } 13 | 14 | IEnumerable results = 15 | from item in sourceData.AsParallel() 16 | where item % 2 == 0 17 | select item; 18 | 19 | foreach (int item in results) { 20 | Console.WriteLine("Item {0}", item); 21 | } 22 | 23 | // wait for input before exiting 24 | Console.WriteLine("Press enter to finish"); 25 | Console.ReadLine(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_04/Listing_04.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_04 { 5 | 6 | class Listing_04 { 7 | 8 | static void Main(string[] args) { 9 | 10 | 11 | string[] messages = { "First task", "Second task", 12 | "Third task", "Fourth task" }; 13 | 14 | foreach (string msg in messages) { 15 | Task myTask = new Task(obj => printMessage((string)obj), msg); 16 | myTask.Start(); 17 | } 18 | 19 | // wait for input before exiting 20 | Console.WriteLine("Main method complete. Press enter to finish."); 21 | Console.ReadLine(); 22 | } 23 | 24 | static void printMessage(string message) { 25 | Console.WriteLine("Message: {0}", message); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel Sort/Use_Parallel_Sort.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Parallel_Sort { 5 | 6 | class Use_Parallel_Sort { 7 | 8 | static void Main(string[] args) { 9 | // generate some random source data 10 | Random rnd = new Random(); 11 | int[] sourceData = new int[5000000]; 12 | for (int i = 0; i < sourceData.Length; i++) { 13 | sourceData[i] = rnd.Next(1, 100); 14 | } 15 | 16 | // perform the parallel sort 17 | Parallel_Sort.ParallelQuickSort(sourceData, new IntComparer()); 18 | } 19 | 20 | public class IntComparer : IComparer { 21 | public int Compare(int first, int second) { 22 | return first.CompareTo(second); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_20/Listing_20.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_20 { 6 | class Listing_20 { 7 | static void Main(string[] args) { 8 | 9 | // use PLINQ to process a parallel range 10 | IEnumerable result1 = 11 | from e in ParallelEnumerable.Range(0, 10) 12 | where e % 2 == 0 13 | select Math.Pow(e, 2); 14 | 15 | 16 | // use PLINQ to process a repeating sequence 17 | IEnumerable result2 = 18 | ParallelEnumerable.Repeat(10, 100) 19 | .Select(item => Math.Pow(item, 2)); 20 | 21 | // wait for input before exiting 22 | Console.WriteLine("Press enter to finish"); 23 | Console.ReadLine(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Map/Use_Parallel_Map.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Parallel_Map { 5 | 6 | class Use_Parallel_Map { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create the source data 11 | int[] sourceData = Enumerable.Range(0, 100).ToArray(); 12 | 13 | // define the mapping function 14 | Func mapFunction = value => Math.Pow(value, 2); 15 | 16 | // map the source data 17 | double[] resultData = Parallel_Map.ParallelMap(mapFunction, sourceData); 18 | 19 | // run through the results 20 | for (int i = 0; i < sourceData.Length; i++) { 21 | Console.WriteLine("Value {0} mapped to {1}", 22 | sourceData[i], 23 | resultData[i]); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Reduce/Use_Parallel_Reduce.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Parallel_Reduce { 5 | 6 | class Use_Parallel_Reduce { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create some source data 11 | int[] sourceData = Enumerable.Range(0, 10).ToArray(); 12 | 13 | // create the aggregation function 14 | Func reduceFunction = (value1, value2) => value1 + value2; 15 | 16 | // perform the reduction 17 | int result = Parallel_Reduce.Reduce(sourceData, 0, reduceFunction); 18 | 19 | // write out the result 20 | Console.WriteLine("Result: {0}", result); 21 | 22 | // wait for input before exiting 23 | Console.WriteLine("Press enter to finish"); 24 | Console.ReadLine(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_04/Listing_04.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_04 { 6 | 7 | class Listing_04 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create a collection of strings 12 | List dataList = new List { 13 | "the", "quick", "brown", "fox", "jumps", "etc" 14 | }; 15 | 16 | // process the elements of the collection 17 | // using a parallel foreach loop 18 | Parallel.ForEach(dataList, item => { 19 | Console.WriteLine("Item {0} has {1} characters", 20 | item, item.Length); 21 | }); 22 | 23 | // wait for input before exiting 24 | Console.WriteLine("Press enter to finish"); 25 | Console.ReadLine(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/ParallelScratch.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asparallel", "asparallel\asparallel.csproj", "{B7DA7D8C-9650-422F-B641-D1BCE69D6F75}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B7DA7D8C-9650-422F-B641-D1BCE69D6F75}.Debug|x86.ActiveCfg = Debug|x86 13 | {B7DA7D8C-9650-422F-B641-D1BCE69D6F75}.Debug|x86.Build.0 = Debug|x86 14 | {B7DA7D8C-9650-422F-B641-D1BCE69D6F75}.Release|x86.ActiveCfg = Release|x86 15 | {B7DA7D8C-9650-422F-B641-D1BCE69D6F75}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_07/Listing_07.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_07 { 6 | class Program { 7 | static void Main(string[] args) { 8 | 9 | List dataItems 10 | = new List() { "an", "apple", "a", "day", 11 | "keeps", "the", "doctor", "away" }; 12 | 13 | Parallel.ForEach(dataItems, (string item, ParallelLoopState state) => { 14 | if (item.Contains("k")) { 15 | Console.WriteLine("Hit: {0}", item); 16 | state.Stop(); 17 | } else { 18 | Console.WriteLine("Miss: {0}", item); 19 | } 20 | }); 21 | 22 | // wait for input before exiting 23 | Console.WriteLine("Press enter to finish"); 24 | Console.ReadLine(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Creating_Race_Conditions/Creating_Race_Conditions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Creating_Race_Conditions { 5 | class Creating_Race_Conditions { 6 | static void Main(string[] args) { 7 | 8 | // create some source data 9 | int[] sourceData = new int[10000]; 10 | for (int i = 0; i < sourceData.Length; i++) { 11 | sourceData[i] = i; 12 | } 13 | 14 | // create a counter - this will be shared 15 | int counter = 1000; 16 | 17 | // create a plinq query that uses the shared value 18 | var result = from e in sourceData.AsParallel() 19 | where (counter-- > 0) 20 | select e; 21 | 22 | Console.WriteLine("Expected {0} items", counter); 23 | Console.WriteLine("Got {0} items", result.ToArray().Length); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_01/Listing_01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_01 { 5 | 6 | class Listing_01 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create the arrays to hold the data and the results 11 | int[] dataItems = new int[100]; 12 | double[] resultItems = new double[100]; 13 | 14 | // create the data items 15 | for (int i = 0; i < dataItems.Length; i++) { 16 | dataItems[i] = i; 17 | } 18 | 19 | // process the data in a parallel for loop 20 | Parallel.For(0, dataItems.Length, (index, loopState) => { 21 | resultItems[index] = Math.Pow(dataItems[index],2); 22 | }); 23 | 24 | // wait for input before exiting 25 | Console.WriteLine("Press enter to finish"); 26 | Console.ReadLine(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Synchronization_in_Loop_Bodies/Synchronization_in_Loop_Bodies.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Synchronization_in_Loop_Bodies { 5 | class Synchronization_in_Loop_Bodies { 6 | static void Main(string[] args) { 7 | 8 | // create the shared data value 9 | double total = 0; 10 | // create a lock object 11 | object lockObj = new object(); 12 | 13 | // perform a parallel loop 14 | Parallel.For( 15 | 0, 16 | 100000, 17 | item => { 18 | // get the lock on the shared value 19 | lock (lockObj) { 20 | // add the square of the current 21 | // value to the running total 22 | total += Math.Pow(item, 2); 23 | } 24 | }); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Using_Standard_Collections/Using_Standard_Collections.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Using_Standard_Collections { 6 | class Using_Standard_Collections { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10000]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // create a list to hold the results 16 | List resultData = new List(); 17 | 18 | Parallel.ForEach(sourceData, item => { 19 | resultData.Add(item); 20 | }); 21 | 22 | Console.WriteLine("Results {0}", resultData.Count); 23 | 24 | // wait for input before exiting 25 | Console.WriteLine("Press enter to finish"); 26 | Console.ReadLine(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_05/Listing_05.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_05 { 6 | class Listing_05 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // preserve order with the AsOrdered() method 16 | IEnumerable results = 17 | from item in sourceData.AsParallel().AsOrdered() 18 | select Math.Pow(item, 2); 19 | 20 | // enumerate the results of the parallel query 21 | foreach (double d in results) { 22 | Console.WriteLine("Parallel result: {0}", d); 23 | } 24 | 25 | // wait for input before exiting 26 | Console.WriteLine("Press enter to finish"); 27 | Console.ReadLine(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_09/Listing_09.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_09 { 6 | class Listing_09 { 7 | static void Main(string[] args) { 8 | 9 | // run a parallel loop in which one of 10 | // the iterations calls Stop() 11 | ParallelLoopResult loopResult = 12 | Parallel.For(0, 10, (int index, ParallelLoopState loopState) => { 13 | if (index == 2) { 14 | loopState.Stop(); 15 | } 16 | }); 17 | 18 | // get the details from the loop result 19 | Console.WriteLine("Loop Result"); 20 | Console.WriteLine("IsCompleted: {0}", loopResult.IsCompleted); 21 | Console.WriteLine("BreakValue: {0}", loopResult.LowestBreakIteration.HasValue); 22 | 23 | // wait for input before exiting 24 | Console.WriteLine("Press enter to finish"); 25 | Console.ReadLine(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_08/Listing_08.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_08 { 6 | class Listing_08 { 7 | static void Main(string[] args) { 8 | 9 | ParallelLoopResult res = Parallel.For(0, 100, 10 | (int index, ParallelLoopState loopState) => { 11 | // calculate the square of the index 12 | double sqr = Math.Pow(index, 2); 13 | // if the square value is > 100 then break 14 | if (sqr > 100) { 15 | Console.WriteLine("Breaking on index {0}", index); 16 | loopState.Break(); 17 | } else { 18 | // write out the value 19 | Console.WriteLine("Square value of {0} is {1}", index, sqr); 20 | } 21 | }); 22 | 23 | // wait for input before exiting 24 | Console.WriteLine("Press enter to finish"); 25 | Console.ReadLine(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_15/Listing_15.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_15 { 6 | 7 | class Listing_15 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create the results array 12 | double[] resultData = new double[10000000]; 13 | 14 | // created a partioner that will chunk the data 15 | OrderablePartitioner> chunkPart = Partitioner.Create(0, resultData.Length, 10000); 16 | 17 | // perform the loop in chunks 18 | Parallel.ForEach(chunkPart, chunkRange => { 19 | // iterate through all of the values in the chunk range 20 | for (int i = chunkRange.Item1; i < chunkRange.Item2; i++) { 21 | resultData[i] = Math.Pow(i, 2); 22 | } 23 | }); 24 | 25 | // wait for input before exiting 26 | Console.WriteLine("Press enter to finish"); 27 | Console.ReadLine(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_12/Listing_12.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_12 { 6 | class Listing_12 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define the query and force parallelism 16 | IEnumerable results = 17 | sourceData.AsParallel() 18 | .WithDegreeOfParallelism(2) 19 | .Where(item => item % 2 == 0) 20 | .Select(item => Math.Pow(item, 2)); 21 | 22 | // enumerate the results 23 | foreach (double d in results) { 24 | Console.WriteLine("Result {0}", d); 25 | } 26 | 27 | // wait for input before exiting 28 | Console.WriteLine("Press enter to finish"); 29 | Console.ReadLine(); 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Speculative_Cache/Use_Speculative_Cache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Speculative_Cache { 5 | 6 | class Use_Speculative_Cache { 7 | static void Main(string[] args) { 8 | 9 | // create a new instance of the cache 10 | Speculative_Cache cache 11 | = new Speculative_Cache( 12 | key1 => { 13 | Console.WriteLine("Created value for key {0}", key1); 14 | return Math.Pow(key1, 2); 15 | }, 16 | key2 => Enumerable.Range(key2 + 1, 5).ToArray()); 17 | 18 | // request some values from the cache 19 | for (int i = 0; i < 100; i++) { 20 | double value = cache.GetValue(i); 21 | Console.WriteLine("Got result {0} for key {1}", value, i); 22 | } 23 | 24 | // wait for input before exiting 25 | Console.WriteLine("Press enter to finish"); 26 | Console.ReadLine(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SourceCode - Final/07 - Testing and Debugging/Listing_03/Listing_03.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_03 { 5 | class Listing_03 { 6 | 7 | static void Main(string[] args) { 8 | 9 | // create a lock object 10 | object lockObj = new object(); 11 | 12 | // create a sequence of tasks that acquire 13 | // the lock in order to perform a 14 | // time-expensive function over and over 15 | Task[] tasks = new Task[10]; 16 | for (int i = 0; i < tasks.Length; i++) { 17 | tasks[i] = Task.Factory.StartNew(() => { 18 | // acquire the lock 19 | lock (lockObj) { 20 | // perform some work 21 | for (int index = 0; index < 50000000; index++) { 22 | Math.Pow(index, 2); 23 | } 24 | } 25 | }); 26 | } 27 | 28 | // wait for the tasks to complete 29 | Task.WaitAll(tasks); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Cache/Use_Parallel_Cache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Parallel_Cache { 5 | 6 | class Use_Parallel_Cache { 7 | static void Main(string[] args) { 8 | 9 | // create the cache 10 | Parallel_Cache cache 11 | = new Parallel_Cache(key => { 12 | Console.WriteLine("Created value for key {0}", key); 13 | return Math.Pow(key, 2); 14 | }); 15 | 16 | for (int i = 0; i < 10; i++) { 17 | Task.Factory.StartNew(() => { 18 | for (int j = 0; j < 20; j++) { 19 | Console.WriteLine( 20 | "Task {0} got value {1} for key {2}", 21 | Task.CurrentId, cache.GetValue(j), j); 22 | } 23 | }); 24 | } 25 | 26 | // wait for input before exiting 27 | Console.WriteLine("Press enter to finish"); 28 | Console.ReadLine(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_11/Listing_11.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_11 { 6 | class Listing_11 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define the query and force parallelism 16 | IEnumerable results = 17 | sourceData.AsParallel() 18 | .WithExecutionMode(ParallelExecutionMode.ForceParallelism) 19 | .Where(item => item % 2 == 0) 20 | .Select(item => Math.Pow(item, 2)); 21 | 22 | // enumerate the results 23 | foreach (double d in results) { 24 | Console.WriteLine("Result {0}", d); 25 | } 26 | 27 | // wait for input before exiting 28 | Console.WriteLine("Press enter to finish"); 29 | Console.ReadLine(); 30 | 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Confusing_Ordering/Confusing_Ordering.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Confusing_Ordering { 5 | class Confusing_Ordering { 6 | static void Main(string[] args) { 7 | 8 | string[] sourceData = new string[] { 9 | "an", "apple", "a", "day", "keeps", 10 | "the", "doctor", "away"}; 11 | 12 | // create an AsOrdered() query 13 | var result1 = sourceData.AsParallel() 14 | .AsOrdered() 15 | .Select(item => item); 16 | 17 | // enumerate the results 18 | foreach (var v in result1) { 19 | Console.WriteLine("AsOrdered() - {0}", v); 20 | } 21 | 22 | // create an OrderBy() query 23 | var result2 = sourceData.AsParallel() 24 | .OrderBy(item => item) 25 | .Select(item => item); 26 | 27 | // enumerate the results 28 | foreach (var v in result2) { 29 | Console.WriteLine("OrderBy() - {0}", v); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Tree_Traverse/Parallel_Tree_Traverse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Parallel_Tree_Traverse { 5 | 6 | public class Tree { 7 | public Tree LeftNode, RightNode; 8 | public T Data; 9 | } 10 | 11 | class TreeTraverser { 12 | public static void TraverseTree(Tree tree, Action action) { 13 | if (tree != null) { 14 | // invoke the action for the data 15 | action.Invoke(tree.Data); 16 | // start tasks to process the left and right nodes if they exist 17 | if (tree.LeftNode != null && tree.RightNode != null) { 18 | Task leftTask = Task.Factory.StartNew( 19 | () => TraverseTree(tree.LeftNode, action)); 20 | Task rightTask = Task.Factory.StartNew( 21 | () => TraverseTree(tree.RightNode, action)); 22 | // wait for the tasks to complete 23 | Task.WaitAll(leftTask, rightTask); 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/linqparttest/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 60 5 | http://svn.xp-dev.com/svn/ParallelBook/SourceCode/ParallelScratch/linqparttest 6 | http://svn.xp-dev.com/svn/ParallelBook 7 | 8 | 9 | 10 | 2010-01-16T15:23:22.160504Z 11 | 29 12 | adamfreeman 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | be42883c-59a8-464b-b0f1-b6c691c3a0dc 28 | 29 | linqparttest.csproj 30 | file 31 | 32 | 33 | 34 | 35 | 2010-01-11T16:06:55.160628Z 36 | 42eab80985bdb2e8cd94440387d30bec 37 | 2010-01-16T15:23:22.160504Z 38 | 29 39 | adamfreeman 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 2445 62 | 63 | Program.cs 64 | file 65 | 66 | 67 | 68 | 69 | 2010-01-11T16:06:48.419243Z 70 | 9a2949961c41790530826159ec31401f 71 | 2010-01-16T15:23:22.160504Z 72 | 29 73 | adamfreeman 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 513 96 | 97 | Properties 98 | dir 99 | 100 | -------------------------------------------------------------------------------- /SourceCode - Final/07 - Testing and Debugging/Listing_05/Listing_05.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_05 { 5 | 6 | class Listing_05 { 7 | 8 | static void Main(string[] args) { 9 | 10 | Task[] tasks = new Task[2]; 11 | for (int i = 0; i < tasks.Length; i++) { 12 | tasks[i] = Task.Factory.StartNew(() => { 13 | for (int j = 0; j < 5000000; j++) { 14 | if (j == 500) { 15 | throw new Exception("Value is 500"); 16 | } 17 | Math.Pow(j, 2); 18 | } 19 | }); 20 | } 21 | 22 | // wait for the tasks and catch any exceptions 23 | try { 24 | Task.WaitAll(tasks); 25 | } catch (AggregateException ex) { 26 | ex.Handle(innerEx => { 27 | Console.WriteLine("Exception message is {0}", innerEx.Message); 28 | return true; 29 | }); 30 | } 31 | 32 | Console.ReadLine(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_13/Listing_13.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_13 { 6 | class Listing_13 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define the query and force parallelism 16 | IEnumerable results = 17 | sourceData.AsParallel() 18 | .WithDegreeOfParallelism(2) 19 | .Where(item => item % 2 == 0) 20 | .Select(item => Math.Pow(item, 2)) 21 | .AsSequential() 22 | .Select(item => item * 2); 23 | 24 | // enumerate the results 25 | foreach (double d in results) { 26 | Console.WriteLine("Result {0}", d); 27 | } 28 | 29 | // wait for input before exiting 30 | Console.WriteLine("Press enter to finish"); 31 | Console.ReadLine(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_07/Listing_07.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Listing_07 { 7 | class Listing_07 { 8 | static void Main(string[] args) { 9 | 10 | // create some source data 11 | int[] sourceData = new int[10000]; 12 | for (int i = 0; i < sourceData.Length; i++) { 13 | sourceData[i] = i; 14 | } 15 | 16 | // define a query that has an ordered subquery 17 | var result = 18 | sourceData.AsParallel().AsOrdered() 19 | .Take(10).AsUnordered() 20 | .Select(item => new { 21 | sourceValue = item, 22 | resultValue = Math.Pow(item, 2) 23 | }); 24 | 25 | foreach (var v in result) { 26 | Console.WriteLine("Source {0}, Result {1}", 27 | v.sourceValue, v.resultValue); 28 | } 29 | 30 | // wait for input before exiting 31 | Console.WriteLine("Press enter to finish"); 32 | Console.ReadLine(); 33 | 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_02/Listing_02.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_02 { 5 | 6 | class Listing_02 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // use an Action delegate and a named method 11 | Task task1 = new Task(new Action(printMessage)); 12 | 13 | // use a anonymous delegate 14 | Task task2 = new Task(delegate { 15 | printMessage(); 16 | }); 17 | 18 | // use a lambda expression and a named method 19 | Task task3 = new Task(() => printMessage()); 20 | 21 | // use a lambda expression and an anonymous method 22 | Task task4 = new Task(() => { 23 | printMessage(); 24 | }); 25 | 26 | task1.Start(); 27 | task2.Start(); 28 | task3.Start(); 29 | task4.Start(); 30 | 31 | // wait for input before exiting 32 | Console.WriteLine("Main method complete. Press enter to finish."); 33 | Console.ReadLine(); 34 | } 35 | 36 | static void printMessage() { 37 | Console.WriteLine("Hello World"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Dependency_Deadlock/Dependency_Deadlock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Dependency_Deadlock { 5 | 6 | class Dependency_Deadlock { 7 | 8 | static void Main(string[] args) { 9 | 10 | // define an array to hold the Tasks 11 | Task[] tasks = new Task[2]; 12 | 13 | // create and start the first task 14 | tasks[0] = Task.Factory.StartNew(() => { 15 | // get the result of the other task, 16 | // add 100 to it and return it as the result 17 | return tasks[1].Result + 100; 18 | }); 19 | 20 | // create and start the second task 21 | tasks[1] = Task.Factory.StartNew(() => { 22 | // get the result of the other task, 23 | // add 100 to it and return it as the result 24 | return tasks[1].Result + 100; 25 | }); 26 | 27 | // wait for the tasks to complete 28 | Task.WaitAll(tasks); 29 | 30 | // wait for input before exiting 31 | Console.WriteLine("Main method complete. Press enter to finish."); 32 | Console.ReadLine(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_16/Listing_16.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_16 { 6 | class Listing_16 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[5]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define a fully buffered query 16 | IEnumerable results = 17 | sourceData.AsParallel() 18 | .WithMergeOptions(ParallelMergeOptions.FullyBuffered) 19 | .Select(item => { 20 | double resultItem = Math.Pow(item, 2); 21 | Console.WriteLine("Produced result {0}", resultItem); 22 | return resultItem; 23 | }); 24 | 25 | // enumerate the query results 26 | foreach (double d in results) { 27 | Console.WriteLine("Enumeration got result {0}", d); 28 | } 29 | 30 | // wait for input before exiting 31 | Console.WriteLine("Press enter to finish"); 32 | Console.ReadLine(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_22/Listing_22.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_22 { 6 | 7 | class Listing_22 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create a collection 12 | Queue sharedQueue = Queue.Synchronized(new Queue()); 13 | 14 | // create tasks to process the list 15 | Task[] tasks = new Task[10]; 16 | for (int i = 0; i < tasks.Length; i++) { 17 | // create the new task 18 | tasks[i] = new Task(() => { 19 | 20 | for (int j = 0; j < 100; j++) { 21 | sharedQueue.Enqueue(j); 22 | } 23 | 24 | }); 25 | // start the new task 26 | tasks[i].Start(); 27 | } 28 | 29 | // wait for the tasks to complete 30 | Task.WaitAll(tasks); 31 | 32 | // report on the number of items enqueued 33 | Console.WriteLine("Items enqueued: {0}", sharedQueue.Count); 34 | 35 | // wait for input before exiting 36 | Console.WriteLine("Press enter to finish"); 37 | Console.ReadLine(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Using_Changing_Data/Using_Changing_Data.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace Using_Changing_Data { 7 | class Using_Changing_Data { 8 | static void Main(string[] args) { 9 | 10 | // create some source data 11 | List sourceData = new List(); 12 | for (int i = 0; i < 10; i++) { 13 | sourceData.Add(i); 14 | } 15 | 16 | // start a task that adds items to the list 17 | Task.Factory.StartNew(() => { 18 | int counter = 10; 19 | while (true) { 20 | Thread.Sleep(250); 21 | Console.WriteLine("Adding item {0}", counter); 22 | sourceData.Add(counter++); 23 | } 24 | }); 25 | 26 | // run a parallel loop on the list 27 | Parallel.ForEach(sourceData, item => { 28 | Console.WriteLine("Processing item {0}", item); 29 | }); 30 | 31 | // wait for input before exiting 32 | Console.WriteLine("Press enter to finish"); 33 | Console.ReadLine(); 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Listing_01/Listing_01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_01 { 5 | 6 | class BankAccount { 7 | public int Balance { 8 | get; 9 | set; 10 | } 11 | } 12 | 13 | class Listing_01 { 14 | 15 | static void Main(string[] args) { 16 | 17 | Task task = new Task(() => { 18 | // create a new bank account 19 | BankAccount account = new BankAccount(); 20 | // enter a loop 21 | for (int i = 0; i < 1000; i++) { 22 | // increment the account total 23 | account.Balance++; 24 | } 25 | // return the bank account 26 | return account; 27 | }); 28 | 29 | task.ContinueWith((Task antecedent) => { 30 | Console.WriteLine("Final Balance: {0}", antecedent.Result.Balance); 31 | }); 32 | 33 | // start the task 34 | task.Start(); 35 | 36 | // wait for input before exiting 37 | Console.WriteLine("Press enter to finish"); 38 | Console.ReadLine(); 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_19/Listing_19.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace Listing_19 { 5 | class Listing_19 { 6 | static void Main(string[] args) { 7 | 8 | // create some source data 9 | int[] sourceData = new int[10000]; 10 | for (int i = 0; i < sourceData.Length; i++) { 11 | sourceData[i] = i; 12 | } 13 | 14 | // perform a custom aggregation 15 | double aggregateResult = sourceData.AsParallel().Aggregate( 16 | // 1st function - initialize the result 17 | 0.0, 18 | // 2nd function - process each item and the per-Task subtotal 19 | (subtotal, item) => subtotal += Math.Pow(item, 2), 20 | // 3rd function - process the overall total and the per-Task total 21 | (total, subtotal) => total + subtotal, 22 | // 4th function - perform final processing 23 | total => total / 2); 24 | 25 | // write out the result 26 | Console.WriteLine("Total: {0}", aggregateResult); 27 | 28 | // wait for input before exiting 29 | Console.WriteLine("Press enter to finish"); 30 | Console.ReadLine(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_02/Listing_02.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Listing_02 { 4 | 5 | class ImmutableBankAccount { 6 | public const int AccountNumber = 123456; 7 | public readonly int Balance; 8 | 9 | public ImmutableBankAccount(int InitialBalance) { 10 | Balance = InitialBalance; 11 | } 12 | 13 | public ImmutableBankAccount() { 14 | Balance = 0; 15 | } 16 | } 17 | 18 | class Listing_02 { 19 | 20 | static void Main(string[] args) { 21 | 22 | // create a bank account with the default balance 23 | ImmutableBankAccount bankAccount1 = new ImmutableBankAccount(); 24 | Console.WriteLine("Account Number: {0}, Account Balance: {1}", 25 | ImmutableBankAccount.AccountNumber, bankAccount1.Balance); 26 | 27 | // create a bank account with a starting balance 28 | ImmutableBankAccount bankAccount2 = new ImmutableBankAccount(200); 29 | Console.WriteLine("Account Number: {0}, Account Balance: {1}", 30 | ImmutableBankAccount.AccountNumber, bankAccount2.Balance); 31 | 32 | // wait for input before exiting 33 | Console.WriteLine("Press enter to finish"); 34 | Console.ReadLine(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Local_Variable_Evaluation/Local_Variable_Evaluation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Local_Variable_Evaluation { 5 | 6 | class Local_Variable_Evaluation { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create and start the "bad" tasks 11 | for (int i = 0; i < 5; i++) { 12 | Task.Factory.StartNew(() => { 13 | // write out a message that uses the loop counter 14 | Console.WriteLine("Task {0} has counter value: {1}", Task.CurrentId, i); 15 | }); 16 | } 17 | 18 | // create and start the "good" tasks 19 | for (int i = 0; i < 5; i++) { 20 | Task.Factory.StartNew((stateObj) => { 21 | // cast the state object to an int 22 | int loopValue = (int)stateObj; 23 | // write out a message that uses the loop counter 24 | Console.WriteLine("Task {0} has counter value: {1}", Task.CurrentId, loopValue); 25 | }, i); 26 | } 27 | 28 | // wait for input before exiting 29 | Console.WriteLine("Main method complete. Press enter to finish."); 30 | Console.ReadLine(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SourceCode - Final/07 - Testing and Debugging/Listing_06/Listing_06.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_06 { 6 | 7 | class Listing_06 { 8 | 9 | static void Main(string[] args) { 10 | // specify the number of tasks 11 | int taskCount = 10; 12 | // create a countdown event so that 13 | // we can wait until all of the tasks 14 | // have been created before breaking 15 | CountdownEvent cdEvent = new CountdownEvent(taskCount); 16 | // create the set of tasks 17 | Task[] tasks = new Task[taskCount]; 18 | for (int i = 0; i < taskCount; i++) { 19 | tasks[i] = Task.Factory.StartNew((stateObj) => { 20 | // signalthe countdown event 21 | cdEvent.Signal(); 22 | // wait on the next task in the array 23 | tasks[(((int)stateObj) + 1) % taskCount].Wait(); 24 | }, i); 25 | } 26 | 27 | // wait for the count down event 28 | cdEvent.Wait(); 29 | // break if there is a debugger attached 30 | if (Debugger.IsAttached) { 31 | Debugger.Break(); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Listing_10/Listing_10.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_10 { 6 | 7 | class Listing_10 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create the parent task 12 | Task parentTask = new Task(() => { 13 | 14 | // create the first child task 15 | Task childTask = new Task(() => { 16 | // write out a message and wait 17 | Console.WriteLine("Child task running"); 18 | Thread.Sleep(1000); 19 | Console.WriteLine("Child task finished"); 20 | throw new Exception(); 21 | }); 22 | 23 | Console.WriteLine("Starting child task..."); 24 | childTask.Start(); 25 | }); 26 | 27 | // start the parent task 28 | parentTask.Start(); 29 | 30 | // wait for the parent task 31 | Console.WriteLine("Waiting for parent task"); 32 | parentTask.Wait(); 33 | Console.WriteLine("Parent task finished"); 34 | 35 | // wait for input before exiting 36 | Console.WriteLine("Press enter to finish"); 37 | Console.ReadLine(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Listing_08/Listing_08.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_08 { 5 | 6 | class Listing_08 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create a first generation task 11 | Task gen1 = new Task(() => { 12 | // write out a message 13 | Console.WriteLine("First generation task"); 14 | }); 15 | 16 | // create a second generation task 17 | Task gen2 = gen1.ContinueWith(antecedent => { 18 | // write out a message 19 | Console.WriteLine("Second generation task - throws exception"); 20 | throw new Exception(); 21 | }); 22 | 23 | // create a third generation task 24 | Task gen3 = gen2.ContinueWith(antecedent => { 25 | // write out a message 26 | Console.WriteLine("Third generation task"); 27 | }); 28 | 29 | // start the first gen task 30 | gen1.Start(); 31 | 32 | // wait for the last task in the chain to complete 33 | gen3.Wait(); 34 | 35 | // wait for input before exiting 36 | Console.WriteLine("Press enter to finish"); 37 | Console.ReadLine(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_03/Listing_03.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_03 { 6 | class Listing_03 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define a sequential linq query 16 | IEnumerable results1 = 17 | sourceData.Select(item => Math.Pow(item, 2)); 18 | 19 | // enumerate the results of the sequential query 20 | foreach (double d in results1) { 21 | Console.WriteLine("Sequential result: {0}", d); 22 | } 23 | 24 | // define a parallel linq query 25 | var results2 = sourceData.AsParallel() 26 | .Select(item => Math.Pow(item, 2)); 27 | 28 | // enumerate the results of the parallel query 29 | foreach (var d in results2) { 30 | Console.WriteLine("Parallel result: {0}", d); 31 | } 32 | 33 | // wait for input before exiting 34 | Console.WriteLine("Press enter to finish"); 35 | Console.ReadLine(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Tree_Traverse/Use_Parallel_Tree_Traverse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Parallel_Tree_Traverse { 4 | 5 | class Use_Parallel_Tree_Traverse { 6 | 7 | static void Main(string[] args) { 8 | 9 | // create and populate a simple tree 10 | Tree tree = populateTree(new Tree(), new Random()); 11 | 12 | // traverse the tree, print out the even values 13 | TreeTraverser.TraverseTree(tree, item => { 14 | if (item % 2 == 0) { 15 | Console.WriteLine("Item {0}", item); 16 | } 17 | }); 18 | 19 | // wait for input before exiting 20 | Console.WriteLine("Press enter to finish"); 21 | Console.ReadLine(); 22 | } 23 | 24 | internal static Tree populateTree(Tree parentNode, 25 | Random rnd, int depth = 0) { 26 | 27 | parentNode.Data = rnd.Next(1, 1000); 28 | if (depth < 10) { 29 | parentNode.LeftNode = new Tree(); 30 | parentNode.RightNode = new Tree(); 31 | populateTree(parentNode.LeftNode, rnd, depth + 1); 32 | populateTree(parentNode.RightNode, rnd, depth + 1); 33 | } 34 | return parentNode; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_03/Listing_03.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_03 { 5 | 6 | class Listing_03 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // use an Action delegate and a named method 11 | Task task1 = new Task(new Action(printMessage), 12 | "First task"); 13 | 14 | // use a anonymous delegate 15 | Task task2 = new Task(delegate(object obj) { 16 | printMessage(obj); 17 | }, "Second Task"); 18 | 19 | // use a lambda expression and a named method 20 | Task task3 = new Task((obj) => printMessage(obj), "Third task"); 21 | 22 | // use a lambda expression and an anonymous method 23 | Task task4 = new Task((obj) => { 24 | printMessage(obj); 25 | }, "Fourth task"); 26 | 27 | task1.Start(); 28 | task2.Start(); 29 | task3.Start(); 30 | task4.Start(); 31 | 32 | // wait for input before exiting 33 | Console.WriteLine("Main method complete. Press enter to finish."); 34 | Console.ReadLine(); 35 | } 36 | 37 | static void printMessage(object message) { 38 | Console.WriteLine("Message: {0}", message); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Decoupled_Console/Decoupled_Console.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Threading.Tasks; 4 | 5 | namespace Decoupled_Console { 6 | class Decoupled_Console { 7 | // queue-based blocking collection 8 | private static BlockingCollection blockingQueue; 9 | // task that processes messages to the console 10 | private static Task messageWorker; 11 | 12 | static Decoupled_Console() { 13 | // create the blocking collection 14 | blockingQueue = new BlockingCollection(); 15 | // create and start the worker task 16 | messageWorker = Task.Factory.StartNew(() => { 17 | foreach (Action action in blockingQueue.GetConsumingEnumerable()) { 18 | // invoke the action 19 | action.Invoke(); 20 | } 21 | }, TaskCreationOptions.LongRunning); 22 | } 23 | 24 | public static void WriteLine(object value) { 25 | blockingQueue.Add(new Action(() => 26 | Console.WriteLine(value))); 27 | } 28 | 29 | public static void WriteLine(string format, params object[] values) { 30 | blockingQueue.Add(new Action(() => 31 | Console.WriteLine(format, values))); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Parallel_Tree_Search/Use_Parallel_Tree_Search.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Parallel_Tree_Search { 4 | class Use_TreeSearch { 5 | 6 | static void Main(string[] args) { 7 | 8 | // create and populate a simple tree 9 | Tree tree = populateTree(new Tree(), new Random(2)); 10 | 11 | // traverse the tree, print out the even values 12 | int result = TreeSearch.SearchTree(tree, item => { 13 | if (item == 183) Console.WriteLine("Value : {0}", item); 14 | return item == 183; 15 | }); 16 | 17 | Console.WriteLine("Search match ? {0}", result); 18 | 19 | // wait for input before exiting 20 | Console.WriteLine("Press enter to finish"); 21 | Console.ReadLine(); 22 | } 23 | 24 | private static Tree populateTree(Tree parentNode, 25 | Random rnd, int depth = 0) { 26 | 27 | parentNode.Data = rnd.Next(1, 1000); 28 | if (depth < 10) { 29 | parentNode.LeftNode = new Tree(); 30 | parentNode.RightNode = new Tree(); 31 | populateTree(parentNode.LeftNode, rnd, depth + 1); 32 | populateTree(parentNode.RightNode, rnd, depth + 1); 33 | } 34 | return parentNode; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_05/Listing_05.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_05 { 5 | 6 | class Listing_05 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create the task 11 | Task task1 = new Task(() => { 12 | int sum = 0; 13 | for (int i = 0; i < 100; i++) { 14 | sum += i; 15 | } 16 | return sum; 17 | }); 18 | 19 | // start the task 20 | task1.Start(); 21 | 22 | // write out the result 23 | Console.WriteLine("Result 1: {0}", task1.Result); 24 | 25 | // create the task using state 26 | Task task2 = new Task(obj => { 27 | int sum = 0; 28 | int max = (int)obj; 29 | for (int i = 0; i < max; i++) { 30 | sum += i; 31 | } 32 | return sum; 33 | }, 100); 34 | 35 | // start the task 36 | task2.Start(); 37 | 38 | // write out the result 39 | Console.WriteLine("Result 2: {0}", task2.Result); 40 | 41 | // wait for input before exiting 42 | Console.WriteLine("Main method complete. Press enter to finish."); 43 | Console.ReadLine(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_02/Listing_02.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_02 { 6 | class Listing_02 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[10]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define a sequential linq query 16 | IEnumerable results1 = 17 | from item in sourceData 18 | select Math.Pow(item, 2); 19 | 20 | // enumerate the results of the sequential query 21 | foreach (double d in results1) { 22 | Console.WriteLine("Sequential result: {0}", d); 23 | } 24 | 25 | // define a parallel linq query 26 | IEnumerable results2 = 27 | from item in sourceData.AsParallel() 28 | select Math.Pow(item, 2); 29 | 30 | // enumerate the results of the parallel query 31 | foreach (double d in results2) { 32 | Console.WriteLine("Parallel result: {0}", d); 33 | } 34 | 35 | // wait for input before exiting 36 | Console.WriteLine("Press enter to finish"); 37 | Console.ReadLine(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_09/Listing_09.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading; 5 | 6 | namespace Listing_09 { 7 | class Listing_09 { 8 | static void Main(string[] args) { 9 | 10 | // create some source data 11 | int[] sourceData = new int[10]; 12 | for (int i = 0; i < sourceData.Length; i++) { 13 | sourceData[i] = i; 14 | } 15 | 16 | Console.WriteLine("Defining PLINQ query"); 17 | // define the query 18 | IEnumerable results = 19 | sourceData.AsParallel().Select(item => { 20 | Console.WriteLine("Processing item {0}", item); 21 | return Math.Pow(item, 2); 22 | }); 23 | 24 | Console.WriteLine("Waiting..."); 25 | Thread.Sleep(5000); 26 | 27 | // sum the results - this will trigger 28 | // execution of the query 29 | Console.WriteLine("Accessing results"); 30 | double total = 0; 31 | foreach (double d in results) { 32 | total += d; 33 | } 34 | Console.WriteLine("Total {0}", total); 35 | 36 | // wait for input before exiting 37 | Console.WriteLine("Press enter to finish"); 38 | Console.ReadLine(); 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_06/Listing_06.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | 6 | namespace Listing_06 { 7 | 8 | class Listing_06 { 9 | 10 | static void Main(string[] args) { 11 | 12 | // create a ParallelOptions instance 13 | // and set the max concurrency to 1 14 | ParallelOptions options 15 | = new ParallelOptions() { MaxDegreeOfParallelism = 1 }; 16 | 17 | // perform a parallel for loop 18 | Parallel.For(0, 10, options, index => { 19 | Console.WriteLine("For Index {0} started", index); 20 | Thread.Sleep(500); 21 | Console.WriteLine("For Index {0} finished", index); 22 | }); 23 | 24 | // create an array of ints to process 25 | int[] dataElements = new int[] { 0, 2, 4, 6, 8 }; 26 | 27 | // perform a parallel foreach loop 28 | Parallel.ForEach(dataElements, options, index => { 29 | Console.WriteLine("ForEach Index {0} started", index); 30 | Thread.Sleep(500); 31 | Console.WriteLine("ForEach Index {0} finished", index); 32 | }); 33 | 34 | // wait for input before exiting 35 | Console.WriteLine("Press enter to finish"); 36 | Console.ReadLine(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_10/Listing_10.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading; 5 | 6 | namespace Listing_10 { 7 | class Listing_10 { 8 | static void Main(string[] args) { 9 | 10 | // create some source data 11 | int[] sourceData = new int[10]; 12 | for (int i = 0; i < sourceData.Length; i++) { 13 | sourceData[i] = i; 14 | } 15 | 16 | Console.WriteLine("Defining PLINQ query"); 17 | // define the query 18 | IEnumerable results = 19 | sourceData.AsParallel().Select(item => { 20 | Console.WriteLine("Processing item {0}", item); 21 | return Math.Pow(item, 2); 22 | }).ToArray(); 23 | 24 | Console.WriteLine("Waiting..."); 25 | Thread.Sleep(5000); 26 | 27 | // sum the results - this will trigger 28 | // execution of the query 29 | Console.WriteLine("Accessing results"); 30 | double total = 0; 31 | foreach (double d in results) { 32 | total += d; 33 | } 34 | Console.WriteLine("Total {0}", total); 35 | 36 | // wait for input before exiting 37 | Console.WriteLine("Press enter to finish"); 38 | Console.ReadLine(); 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_14/Listing_14.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_14 { 5 | class Listing_14 { 6 | 7 | delegate void ProcessValue(int value); 8 | static double[] resultData = new double[10000000]; 9 | 10 | static void Main(string[] args) { 11 | 12 | // perform the parallel loop 13 | Parallel.For(0, resultData.Length, (int index) => { 14 | // compuute the result for the current index 15 | resultData[index] = Math.Pow(index, 2); 16 | }); 17 | 18 | // perform the loop again, but make the delegate explicit 19 | Parallel.For(0, resultData.Length, delegate(int index) { 20 | resultData[index] = Math.Pow((double)index, 2); 21 | }); 22 | 23 | // perform the loop once more, but this time using 24 | // a declared delegate and action 25 | ProcessValue pdel = new ProcessValue(computeResultValue); 26 | Action paction = new Action(pdel); 27 | Parallel.For(0, resultData.Length, paction); 28 | 29 | // wait for input before exiting 30 | Console.WriteLine("Press enter to finish"); 31 | Console.ReadLine(); 32 | } 33 | 34 | static void computeResultValue(int indexValue) { 35 | resultData[indexValue] = Math.Pow(indexValue, 2); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_23/Listing_23.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_23 { 5 | 6 | class Listing_23 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // define the function 11 | Func taskBody = new Func(() => { 12 | Console.WriteLine("Task body working..."); 13 | return "Task Result"; 14 | }); 15 | 16 | // create the lazy variable 17 | Lazy> lazyData = new Lazy>(() => 18 | Task.Factory.StartNew(taskBody)); 19 | 20 | Console.WriteLine("Calling lazy variable"); 21 | Console.WriteLine("Result from task: {0}", lazyData.Value.Result); 22 | 23 | // do the same thing in a single statement 24 | Lazy> lazyData2 = new Lazy>( 25 | () => Task.Factory.StartNew(() => { 26 | Console.WriteLine("Task body working..."); 27 | return "Task Result"; 28 | })); 29 | 30 | Console.WriteLine("Calling second lazy variable"); 31 | Console.WriteLine("Result from task: {0}", lazyData2.Value.Result); 32 | 33 | // wait for input before exiting 34 | Console.WriteLine("Main method complete. Press enter to finish."); 35 | Console.ReadLine(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_04/Listing_04.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_04 { 6 | class Listing_04 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[100000]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define a filtering query using keywords 16 | IEnumerable results1 17 | = from item in sourceData.AsParallel() 18 | where item % 2 == 0 19 | select Math.Pow(item, 2); 20 | 21 | // enumerate the results 22 | foreach (var d in results1) { 23 | Console.WriteLine("Result: {0}", d); 24 | } 25 | 26 | // define a filtering query using extension methods 27 | IEnumerable results2 28 | = sourceData.AsParallel() 29 | .Where(item => item % 2 == 0) 30 | .Select(item => Math.Pow(item, 2)); 31 | 32 | // enumerate the results 33 | foreach (var d in results2) { 34 | Console.WriteLine("Result: {0}", d); 35 | } 36 | 37 | // wait for input before exiting 38 | Console.WriteLine("Press enter to finish"); 39 | Console.ReadLine(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Trying_To_Take_Concurrently/Trying_To_Take_Concurrently.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Threading.Tasks; 4 | 5 | namespace Trying_To_Take_Concurrently { 6 | class Trying_To_Take_Concurrently { 7 | static void Main(string[] args) { 8 | 9 | // create a blocking collection 10 | BlockingCollection blockingCollection 11 | = new BlockingCollection(); 12 | 13 | // create and start a producer 14 | Task.Factory.StartNew(() => { 15 | // put items into the collectioon 16 | for (int i = 0; i < 1000; i++) { 17 | blockingCollection.Add(i); 18 | } 19 | // mark the collection as complete 20 | blockingCollection.CompleteAdding(); 21 | }); 22 | 23 | // create and start a producer 24 | Task.Factory.StartNew(() => { 25 | while (!blockingCollection.IsCompleted) { 26 | // take an item from the collection 27 | int item = blockingCollection.Take(); 28 | // print out the item 29 | Console.WriteLine("Item {0}", item); 30 | } 31 | }); 32 | 33 | // wait for input before exiting 34 | Console.WriteLine("Press enter to finish"); 35 | Console.ReadLine(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Listing_02/Listing_02.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_02 { 5 | 6 | class BankAccount { 7 | public int Balance { 8 | get; 9 | set; 10 | } 11 | } 12 | 13 | class Listing_02 { 14 | 15 | static void Main(string[] args) { 16 | 17 | Task task = new Task(() => { 18 | // create a new bank account 19 | BankAccount account = new BankAccount(); 20 | // enter a loop 21 | for (int i = 0; i < 1000; i++) { 22 | // increment the account total 23 | account.Balance++; 24 | } 25 | // return the bank account 26 | return account; 27 | }); 28 | 29 | Task continuationTask 30 | = task.ContinueWith((Task antecedent) => { 31 | Console.WriteLine("Interim Balance: {0}", antecedent.Result.Balance); 32 | return antecedent.Result.Balance * 2; 33 | }); 34 | 35 | // start the task 36 | task.Start(); 37 | 38 | Console.WriteLine("Final balance: {0}", continuationTask.Result); 39 | 40 | // wait for input before exiting 41 | Console.WriteLine("Press enter to finish"); 42 | Console.ReadLine(); 43 | 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_02/Listing_02.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_02 { 5 | 6 | class Listing_02 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // invoke actions described by lambda expressions 11 | Parallel.Invoke( 12 | () => Console.WriteLine("Action 1"), 13 | () => Console.WriteLine("Action 2"), 14 | () => Console.WriteLine("Action 3")); 15 | 16 | // explicitly create an array of actions 17 | Action[] actions = new Action[3]; 18 | actions[0] = new Action(() => Console.WriteLine("Action 4")); 19 | actions[1] = new Action(() => Console.WriteLine("Action 5")); 20 | actions[2] = new Action(() => Console.WriteLine("Action 6")); 21 | 22 | // invoke the actions array 23 | Parallel.Invoke(actions); 24 | 25 | // create the same effect using tasks explicitly 26 | Task parent = Task.Factory.StartNew(() => { 27 | foreach (Action action in actions) { 28 | Task.Factory.StartNew(action, TaskCreationOptions.AttachedToParent); 29 | } 30 | }); 31 | // wait for the task to finish 32 | parent.Wait(); 33 | 34 | // wait for input before exiting 35 | Console.WriteLine("Press enter to finish"); 36 | Console.ReadLine(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Pipeline/Use_Pipeline.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Pipeline { 4 | 5 | class Use_Pipleline { 6 | static void Main(string[] args) { 7 | 8 | // create a set of functions that we want to pipleline together 9 | Func func1 = (input => Math.Pow(input, 2)); 10 | Func func2 = (input => input / 2); 11 | Func func3 = (input => input % 2 == 0 && input > 100); 12 | 13 | // define a callback 14 | Action callback = (input, output) => { 15 | if (output) { 16 | Console.WriteLine("Found value {0} with result {1}", input, output); 17 | } 18 | }; 19 | 20 | // create the pipeline 21 | Pipeline pipe = new Pipeline(func1).AddFunction(func2).AddFunction(func3); 22 | // start the pipeline 23 | pipe.StartProcessing(); 24 | 25 | // generate values and push them into the pipeline 26 | for (int i = 0; i < 1000; i++) { 27 | Console.WriteLine("Added value {0}", i); 28 | pipe.AddValue(i, callback); 29 | } 30 | 31 | // stop the pipeline 32 | pipe.StopProcessing(); 33 | 34 | // wait for input before exiting 35 | Console.WriteLine("Press enter to finish"); 36 | Console.ReadLine(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_08/Listing_08.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_08 { 6 | 7 | class BankAccount { 8 | public int Balance = 0; 9 | } 10 | 11 | class Listing_08 { 12 | 13 | static void Main(string[] args) { 14 | 15 | // create the bank account instance 16 | BankAccount account = new BankAccount(); 17 | 18 | // create an array of tasks 19 | Task[] tasks = new Task[10]; 20 | 21 | for (int i = 0; i < 10; i++) { 22 | // create a new task 23 | tasks[i] = new Task(() => { 24 | // enter a loop for 1000 balance updates 25 | for (int j = 0; j < 1000; j++) { 26 | // update the balance 27 | Interlocked.Increment(ref account.Balance); 28 | } 29 | }); 30 | // start the new task 31 | tasks[i].Start(); 32 | } 33 | 34 | // wait for all of the tasks to complete 35 | Task.WaitAll(tasks); 36 | 37 | // write out the counter value 38 | Console.WriteLine("Expected value {0}, Balance: {1}", 39 | 10000, account.Balance); 40 | 41 | // wait for input before exiting 42 | Console.WriteLine("Press enter to finish"); 43 | Console.ReadLine(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Listing_04/Listing_04.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_04 { 5 | 6 | class Listing_04 { 7 | 8 | static void Main(string[] args) { 9 | 10 | // create the first generation task 11 | Task firstGen = new Task(() => { 12 | Console.WriteLine("Message from first generation task"); 13 | // comment out this line to stop the fault 14 | throw new Exception(); 15 | }); 16 | 17 | // create the second generation task - only to run on exception 18 | Task secondGen1 = firstGen.ContinueWith(antecedent => { 19 | // write out a message with the antecedent exception 20 | Console.WriteLine("Antecedent task faulted with type: {0}", 21 | antecedent.Exception.GetType()); 22 | }, TaskContinuationOptions.OnlyOnFaulted); 23 | 24 | // create the second generation task - only to run on no exception 25 | Task secondGen2 = firstGen.ContinueWith(antecedent => { 26 | Console.WriteLine("Antecedent task NOT faulted"); 27 | }, TaskContinuationOptions.NotOnFaulted); 28 | 29 | // start the first generation task 30 | firstGen.Start(); 31 | 32 | // wait for input before exiting 33 | Console.WriteLine("Press enter to finish"); 34 | Console.ReadLine(); 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_14/Listing_14.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Listing_14 { 6 | class Listing_14 { 7 | static void Main(string[] args) { 8 | 9 | // create some source data 10 | int[] sourceData = new int[100]; 11 | for (int i = 0; i < sourceData.Length; i++) { 12 | sourceData[i] = i; 13 | } 14 | 15 | // define the query and force parallelism 16 | IEnumerable results = 17 | sourceData.AsParallel() 18 | .Select(item => { 19 | if (item == 45) { 20 | throw new Exception(); 21 | } 22 | return Math.Pow(item, 2); 23 | }); 24 | 25 | // enumerate the results 26 | try { 27 | foreach (double d in results) { 28 | Console.WriteLine("Result {0}", d); 29 | } 30 | } catch (AggregateException aggException) { 31 | aggException.Handle(exception => { 32 | Console.WriteLine("Handled exception of type: {0}", 33 | exception.GetType()); 34 | return true; 35 | }); 36 | } 37 | 38 | // wait for input before exiting 39 | Console.WriteLine("Press enter to finish"); 40 | Console.ReadLine(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_01/Listing_01.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace Listing_01 { 5 | 6 | class BankAccount { 7 | public int Balance { 8 | get; 9 | set; 10 | } 11 | } 12 | 13 | class Listing_01 { 14 | 15 | static void Main(string[] args) { 16 | 17 | // create the bank account instance 18 | BankAccount account = new BankAccount(); 19 | 20 | // create an array of tasks 21 | Task[] tasks = new Task[10]; 22 | 23 | for (int i = 0; i < 10; i++) { 24 | // create a new task 25 | tasks[i] = new Task(() => { 26 | // enter a loop for 1000 balance updates 27 | for (int j = 0; j < 1000; j++) { 28 | // update the balance 29 | account.Balance = account.Balance + 1; 30 | } 31 | }); 32 | // start the new task 33 | tasks[i].Start(); 34 | } 35 | 36 | // wait for all of the tasks to complete 37 | Task.WaitAll(tasks); 38 | 39 | // write out the counter value 40 | Console.WriteLine("Expected value {0}, Counter value: {1}", 41 | 10000, account.Balance); 42 | 43 | // wait for input before exiting 44 | Console.WriteLine("Press enter to finish"); 45 | Console.ReadLine(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_13/Listing_13.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_13 { 6 | 7 | class Listing_13 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // declare the name we will use for the mutex 12 | string mutexName = "myApressMutex"; 13 | 14 | // declare the mutext 15 | Mutex namedMutext; 16 | 17 | try { 18 | // test to see if the named mutex already exists 19 | namedMutext = Mutex.OpenExisting(mutexName); 20 | } catch (WaitHandleCannotBeOpenedException) { 21 | // the mutext does not exist - we must create it 22 | namedMutext = new Mutex(false, mutexName); 23 | } 24 | 25 | // create the task 26 | Task task = new Task(() => { 27 | while (true) { 28 | // acquire the mutex 29 | Console.WriteLine("Waiting to acquire Mutex"); 30 | namedMutext.WaitOne(); 31 | Console.WriteLine("Acquired Mutex - press enter to release"); 32 | Console.ReadLine(); 33 | namedMutext.ReleaseMutex(); 34 | Console.WriteLine("Released Mutex"); 35 | } 36 | }); 37 | 38 | // start the task 39 | task.Start(); 40 | 41 | // wait for the task to complete 42 | task.Wait(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_16/Listing_16.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | 6 | namespace Listing_16 { 7 | class Listing_16 { 8 | static void Main(string[] args) { 9 | 10 | // create the source data 11 | IList sourceData 12 | = new List() { "an", "apple", "a", "day", 13 | "keeps", "the", "doctor", "away" }; 14 | 15 | // create an array to hold the results 16 | string[] resultData = new string[sourceData.Count]; 17 | 18 | // create an orderable partitioner 19 | OrderablePartitioner op = Partitioner.Create(sourceData); 20 | 21 | // perform the parallel loop 22 | Parallel.ForEach(op, (string item, ParallelLoopState loopState, long index) => { 23 | // process the item 24 | if (item == "apple") item = "apricot"; 25 | // use the index to set the result in the array 26 | resultData[index] = item; 27 | }); 28 | 29 | // print out the contents of the result array 30 | for (int i = 0; i < resultData.Length; i++) { 31 | Console.WriteLine("Item {0} is {1}", i, resultData[i]); 32 | } 33 | 34 | // wait for input before exiting 35 | Console.WriteLine("Press enter to finish"); 36 | Console.ReadLine(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /SourceCode - Final/04 - Coordinating Tasks/Listing_13/Listing_13.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_13 { 6 | 7 | class Listing_13 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create a barrier 12 | Barrier barrier = new Barrier(2); 13 | 14 | // create a task that will complete 15 | Task.Factory.StartNew(() => { 16 | Console.WriteLine("Good task starting phase 0"); 17 | barrier.SignalAndWait(); 18 | Console.WriteLine("Good task starting phase 1"); 19 | barrier.SignalAndWait(); 20 | Console.WriteLine("Good task completed"); 21 | }); 22 | 23 | // create a task that will throw an exception 24 | // with a selective continuation that will reduce the 25 | // particpant count in the barrier 26 | Task.Factory.StartNew(() => { 27 | Console.WriteLine("Bad task 1 throwing exception"); 28 | throw new Exception(); 29 | 30 | }).ContinueWith(antecedent => { 31 | // reduce the particpant count 32 | Console.WriteLine("Reducing the barrier participant count"); 33 | barrier.RemoveParticipant(); 34 | }, TaskContinuationOptions.OnlyOnFaulted); 35 | 36 | // wait for input before exiting 37 | Console.WriteLine("Press enter to finish"); 38 | Console.ReadLine(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_14/Listing_14.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_14 { 6 | 7 | class Listing_14 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create the cancellation token source 12 | CancellationTokenSource tokenSource = new CancellationTokenSource(); 13 | // create the cancellation token 14 | CancellationToken token = tokenSource.Token; 15 | 16 | // create the first task, which we will let run fully 17 | Task task1 = new Task(() => { 18 | for (int i = 0; i < Int32.MaxValue; i++) { 19 | // put the task to sleep for 10 seconds 20 | Thread.Sleep(10000); 21 | // print out a message 22 | Console.WriteLine("Task 1 - Int value {0}", i); 23 | // check for task cancellation 24 | token.ThrowIfCancellationRequested(); 25 | } 26 | }, token); 27 | 28 | // start task 29 | task1.Start(); 30 | 31 | // wait for input before exiting 32 | Console.WriteLine("Press enter to cancel token."); 33 | Console.ReadLine(); 34 | 35 | // cancel the token 36 | tokenSource.Cancel(); 37 | 38 | // wait for input before exiting 39 | Console.WriteLine("Main method complete. Press enter to finish."); 40 | Console.ReadLine(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SourceCode - Final/02 - Task Programming/Listing_15/Listing_15.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_15 { 6 | 7 | class Listing_15 { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create the cancellation token source 12 | CancellationTokenSource tokenSource = new CancellationTokenSource(); 13 | // create the cancellation token 14 | CancellationToken token = tokenSource.Token; 15 | 16 | // create the first task, which we will let run fully 17 | Task task1 = new Task(() => { 18 | for (int i = 0; i < Int32.MaxValue; i++) { 19 | // put the task to sleep for 10 seconds 20 | Thread.SpinWait(10000); 21 | // print out a message 22 | Console.WriteLine("Task 1 - Int value {0}", i); 23 | // check for task cancellation 24 | token.ThrowIfCancellationRequested(); 25 | } 26 | }, token); 27 | 28 | // start task 29 | task1.Start(); 30 | 31 | // wait for input before exiting 32 | Console.WriteLine("Press enter to cancel token."); 33 | Console.ReadLine(); 34 | 35 | // cancel the token 36 | tokenSource.Cancel(); 37 | 38 | // wait for input before exiting 39 | Console.WriteLine("Main method complete. Press enter to finish."); 40 | Console.ReadLine(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Speculative_Selection/Use_Speculative_Selection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Speculative_Selection { 6 | 7 | class Use_Speculative_Suggestion { 8 | 9 | static void Main(string[] args) { 10 | 11 | // create some sample functions 12 | Func pFunction = value => { 13 | Random rnd = new Random(); 14 | Thread.Sleep(rnd.Next(1, 2000)); 15 | return Math.Pow(value, 2); 16 | }; 17 | 18 | // create some sample functions 19 | Func pFunction2 = value => { 20 | Random rnd = new Random(); 21 | Thread.Sleep(rnd.Next(1, 1000)); 22 | return Math.Pow(value, 2); 23 | }; 24 | 25 | // define the callback 26 | Action callback = (index, result) => { 27 | Console.WriteLine("Received result of {0} from function {1}", 28 | result, index); 29 | }; 30 | 31 | // speculative compute for some values 32 | for (int i = 0; i < 10; i++) { 33 | Speculative_Selection.Compute( 34 | i, 35 | callback, 36 | pFunction, pFunction2); 37 | } 38 | 39 | // wait for input before exiting 40 | Console.WriteLine("Press enter to finish"); 41 | Console.ReadLine(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_12/Listing_12.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace Listing_12 { 6 | class Listing_12 { 7 | static void Main(string[] args) { 8 | 9 | // create a running total of matched words 10 | int matchedWords = 0; 11 | // create a lock object 12 | object lockObj = new object(); 13 | 14 | // define the source data 15 | string[] dataItems 16 | = new string[] { "an", "apple", "a", "day", 17 | "keeps", "the", "doctor", "away" }; 18 | 19 | // perform a parallel foreach loop with TLS 20 | Parallel.ForEach( 21 | dataItems, 22 | () => 0, 23 | (string item, ParallelLoopState loopState, int tlsValue) => { 24 | // increment the tls value if the item 25 | // contains the letter 'a' 26 | if (item.Contains("a")) { 27 | tlsValue++; 28 | } 29 | return tlsValue; 30 | }, 31 | tlsValue => { 32 | lock (lockObj) { 33 | matchedWords += tlsValue; 34 | } 35 | }); 36 | 37 | Console.WriteLine("Matches: {0}", matchedWords); 38 | 39 | // wait for input before exiting 40 | Console.WriteLine("Press enter to finish"); 41 | Console.ReadLine(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SourceCode - Final/ParallelScratch/asparallel/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("asparallel")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("asparallel")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6eacfcd9-63f2-4d6e-884f-f644a0c58a78")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_01/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_01")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_01")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6484e880-71ba-4aff-8668-3fd4d764c9fb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_02/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_02")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_02")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("337aa505-4ab4-4d9a-9add-8f56ab14d6fc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_03/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_03")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_03")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("616525be-2209-492e-ae29-b995a8c38545")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_04/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_04")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_04")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("23b9a113-71ec-425c-9644-5d9fbe7413d7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_05/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_05")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_05")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fb9ed4f8-fd7f-47cc-a96b-e03f92320938")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_06/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_06")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_06")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f5080474-a9c0-4a17-bf1b-8151617d4e45")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_07/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_07")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_07")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f8b72eba-2ac4-45e7-b0ce-e13e4951d673")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_08/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_08")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_08")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("539acef7-af72-46c5-951f-1e4407aedf05")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_09/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_09")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_09")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3f82ff17-46f3-49f9-bf08-836d8d72a59f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_10/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_10")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_10")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("edfb5a2a-8822-4f11-b337-56c6e01b3fe4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_11/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_11")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_11")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2d392b6c-d9f5-445a-8205-c6e237f96120")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_12/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_12")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_12")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("865a97d6-1858-4a82-ae2c-5d968a46bcae")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_13/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_13")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_13")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("dc733c17-3b59-4452-bde9-bb2bbb21e4d0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_14/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_14")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_14")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("11ba4470-7332-44f0-92b1-c537a3b8c66a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_15/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_15")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_15")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f8a4771b-7b4a-4280-b2d2-a4d658cb0beb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_16/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_16")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_16")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5996a0a7-6c5c-4491-8fa4-fa9b48cd2691")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_17/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_17")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_17")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e9b997da-2c49-4143-b6c2-e78369752586")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_18/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_18")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_18")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("afdd50ac-83d9-47a9-83e4-881e0eb6fd8e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_19/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_19")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_19")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d98b6854-b8aa-4599-8d7f-b745dbb8f967")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_20/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_20")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_20")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4b3f9c86-8db7-4e48-a464-6b755783518b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_21/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_21")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_21")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("540720b9-8f11-4466-abae-79d662fc56c9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_22/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_22")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_22")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5815d820-1386-4c94-97df-2bc3ef8556cf")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/03 - Sharing Data/Listing_23/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_23")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_23")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9e5d1e86-9345-4439-b2c9-4c9b224a8c5c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_01/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_01")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_01")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cec86665-bd8f-42b9-8088-6c2bdf549410")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_02/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_02")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_02")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bd940033-ae2c-4644-aca5-4b0ed35af2b8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_03/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_03")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_03")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("af0e27bf-f6cd-407b-b400-c432495a494d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_04/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_04")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_04")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7e74dbd9-9371-42f2-ae03-d7da993339ec")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_05/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_05")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_05")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3846d499-82aa-45a9-8c04-ada6e8816d91")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_06/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_06")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_06")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4561f31a-d45f-43e3-a86b-90ee5938d734")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_07/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_07")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_07")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1dbf05fc-a026-4d06-8b20-fec2498341dc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_08/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_08")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_08")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("be002f0a-000b-40b4-bcc0-09e64889cd0e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_09/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_09")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_09")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("94b08a9c-84c9-4281-824d-9054989ec41a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_10/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_10")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_10")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("328b2d23-d1ad-48c8-8c25-6f67fabd6b59")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_11/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_11")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_11")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b7c76050-ed98-49b4-95a0-eb2bf7d20774")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_12/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_12")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_12")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ea49e90f-585a-40fa-8615-cb54d48cbd36")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_13/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_26")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_26")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0e05d7ea-2881-4087-ad1a-ece3ee9d65c6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_14/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_13")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_13")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bdb2c9b8-1846-4589-bb9f-d0646fc87feb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_15/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_14")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_14")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d9f16337-8dbd-4508-8d3c-980daab47fec")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_16/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_15")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_15")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("36019559-77f0-4819-bc72-57db82afa086")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/05 - Parallel Loops/Listing_26/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_16")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_16")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bd1719d1-c4c3-43b1-8af2-1851c8d76032")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_01/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_01")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_01")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("afda4434-609b-4bfb-87d0-6832a6c7b697")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_02/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_02")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_02")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7f0dd840-462f-425f-bc12-72fc958254a4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_03/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_03")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_03")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0e8e0acb-84a0-49b3-a9b6-fb3ae3f7ed46")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_04/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_04")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_04")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d84faef1-04e2-43dc-aa1d-fce5062fc363")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_05/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_05")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_05")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("160690cd-42a7-4b05-b4e1-644b18e427d6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_06/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_06")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_06")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3be1d9b1-6500-4a89-922a-cd238fe3ffc9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_07/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_07")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_07")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3471a0b0-14c1-4da5-a07b-2b54efd975ab")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_08/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_08")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_08")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b2822759-05fa-4b43-85f1-9caa75964833")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_09/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_09")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_09")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("93d47639-15b6-4483-9c10-48516a25b045")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_10/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_10")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_10")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("61d85823-5f3d-4694-a7a6-63e1ab127297")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_11/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_11")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_11")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0b7b45a1-dda4-4c6f-828f-0a9c9d65c759")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_12/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_12")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_12")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4f04b24f-30ad-4ace-88ff-cd81ec9fa6f9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_13/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_13")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_13")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("30190e7f-ff06-43c5-8246-9ffb68a18f0f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_14/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_14")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_14")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fe5ea71c-2faa-4881-ba84-bfedc7e7e168")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_15/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_15")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_15")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a159ef59-0132-46cd-b460-f3148127d503")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_16/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_16")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_16")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6cc905ad-0261-4003-b39d-4ba1c55e1f0e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_19/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_19")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_19")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7416c1b6-123e-4c34-a7ed-6b90ef92a813")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/06 - Parallel LINQ/Listing_20/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Listing_20")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Listing_20")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bfdbabac-6b45-43a7-8929-9d4394155b4e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SourceCode - Final/08 - Common Algorithms/Pipeline/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Pipeline")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Pipeline")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6fa562bb-eee4-4fcc-9f03-b5c2e2784835")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | --------------------------------------------------------------------------------