MulticoreInfo.com header image 2

Solving The Dining Philosophers Problem With Asynchronous Agents

May 27th, 2009 · No Comments




by Rick Molloy for MSDN Magazine
Enabling C++ developers to write highly concurrent applications is a major focus of Visual Studio 2010. The beta release includes the Concurrency Runtime, parallel libraries, and development tools aimed at addressing several common problems preventing developers from unlocking the performance potential inherent to multicore hardware. Notably, this includes ensuring that developers can identify and take advantage of opportunities for concurrency in their code, productively manage shared state and its side effects, and not having to worry about building low-overhead concurrency infrastructure that is scalable at run time on a variety of hardware.

This article demonstrates how to use the new Asynchronous Agents Library included as part of Visual C++ 2010 to manage the difficulties that can arise with shared state. To show how this works, Rick walks through an implementation of a classic concurrency problem: Djikstra’s Dining Philosophers. You’ll see how the actor-based programming construct of an agent in combination with asynchronous message-passing APIs can be used to provide a correct and easy to understand solution to this problem that doesn’t rely directly on threading or synchronization primitives.

Full Story

  • Share/Save/Bookmark

Tags: MulticoreInfo · Programming

Like what you're reading? Come back every day for multicore news, or subscribe to RSS updates.



Stumble It!