Parallel Programming in Native Code

Parallel programming using C++ AMP, PPL and Agents libraries.

Samples updated for ConcRT, PPL and Agents

Samples updated for ConcRT, PPL and Agents

  • Comments 6

We’ve posted an update to our sample pack at for the release candidate of Visual Studio 2010. There’s a lot of good stuff from the team here including demos, concurrent data structures and additional parallel algorithms and helper functions.

New Demos:
There are 3 new demos in the sample pack:

The parallel plug-in for excel we blogged about earlier is now available in the sample pack it’s a great example of how to use the PPL for financial applications and how to build an excel plug-in in C++.

An n-bodies implementation has been built on top of Direct2D and is an example of how to build an application from the ground up using both the Agents library and the PPL for fine-grained concurrency and asynchronous communication.

Carmichaels is a very short example I put together for PDC to show the performance gains of nesting parallel loops and relies on the algorithms in ppl_extras.h

Here’s what’s new (and old) in the concrt extras:

ppl_extras.h has been updated to include parallel_sort, parallel_merge and parallel_count_if which as usual mimic their stl counterparts. It also contains what was added in the previous update: parallel_accumulate (reduce), parallel_partial_sum (scan), parallel_transform (map), parallel_all_of, parallel_any_of, parallel_none_of and also parallel_for_fixed, parallel_accumulate_fixed, parallel_partial_sum_fixed.

agents_extras.h additional useful message blocks like priority_buffer, bounded_buffer, alternator, join_transform and  a recalculate_buffer.

concrt_extras.h contains useful wrapper classes and functions from the runtime itself like concrt_suballocator a std::allocator built on Concurrency::Alloc, task_scheduler, schedule_group and schedule_task which are simple wrapper classes around Scheduler and ScheduleGroup that offer functor support like PPL for scheduling tasks.

connect.h contains a new helper API called ‘connect’ for connecting and disconnecting message blocks and agents that contain message blocks, a blog post will follow but this presents a cleaner interface for managing a mix of pointers and references to message blocks.

concurrent_unordered_map,h and concurrent_hash_map.h: as their name implies these are lock-free implementations of an unordered_map and hash_map.

semaphore.h and barrier.h: contains efficient and concrt aware implementations of a semaphore and barrier.

These are located in the Concurrency::samples namespace and the team will be blogging about many of these over the coming weeks, but please feel free to ask any questions here or in the forums.


Blog - Comment List MSDN TechNet
  • Loading...
Leave a Comment
  • Please add 3 and 5 and type the answer here:
  • Post