Intel® Threading Building Blocks goes open source

Library Components

Threading Building Blocks contains the following library components:

Generic Parallel Algorithms

  • parallel_for
  • parallel_reduce
  • parallel_scan
  • parallel_sort
  • parallel_while
  • pipeline


Assistant Classes to Use with Algorithms

  • blocked_range (for use with algorithms, containers, etc.)
  • blocked_range2d (for use with algorithms, containers, etc.)


Thread-Safe Containers

  • concurrent_hash_map
  • concurrent_queue
  • concurrent_vector


Synchronization Primitives

  • atomic
  • spin_mutex
  • spin_rw_mutex (reader-writer spin mutex)
  • queuing_mutex
  • queuing_rw_mutex (reader-writer queuing mutex)
  • mutex


Task Scheduler

Memory Allocation

  • scalable_allocator
  • cache_aligned_allocator
  • aligned_space


Timing

  • tick_count
Advertisements

Filter, Map and Reduce in C Sharp 3.0

Did it with .NET – A Higher Calling (revisited)

… already have equivalents in the .NET Framework 3.5.

1. Filter = Where

2. Map = Select

3. Reduce = Aggregate

Each of these are implemented as extension methods for IEnumerable. So, we can rewrite the code like this:


static void Main()
{

var numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
var sum = numbers.Where(x => (x % 2) == 0).Select(x => x * x).Aggregate(0, (x, y) => x + y);
Console.WriteLine(“Sum: {0}”, sum);

}