Windows Workflow Foundation: Concurrency by Stealth

I just picked up this thread by Joel Pobar discussing the current state of play with concurrency in computing. I respect Joel, he is one of the smartest people that I know and I think that he is right, we will end up with a lot of the hard work done down in the plumbing but it still isn’t going to be for free. The software that we write is going to need to tackle problems in a different way.

First of all we are going to need to make it fairly obvious which parts of our code base can be executed on a seperate logical thread, this will allow the scheduling routines in the runtime/operating system to start to leverage those multiple cores that we have at our disposal.

Enter Windows Workflow Foundation

Windows Workflow Foundation is not the first attempt by an organisation to provide a workflow solution that targets developers and users alike, but upon closer inspection the actual architecture of WF leads me to believe that it will be one of the vehicles that programmers (on the Microsoft platform atleast) use to achieve a higher degree of concurrency potential in their applications.

One of the partners of concurrency is asynchronicity and Windows Workflow Foundation is designed from the ground up to support the asynchronous execution of business logic. Each workflow is invoked on its own thread and within the workflow you can have multiple threads of execution.

Where it gets interesting is that it forces interactions with external services to follow an asynchronous pattern where you invoke an external data exchange service and then wait for an event to come back. This forced seperation triggers the developer to consider WHEN they need the result of an external service call and allows the runtime to schedule those calls as background operations while the main workflow thread continues.

WF has simply addressed the problem of how to visualize concurrent programming constructs, its a technology that is available right now and developers are already starting to use it, in effect we are building in concurrency into our applications by stealth.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s