This project is read-only.
Project Description
An activity that synchronizes its child activity between different instances of workflows. This is similar to the SynchronizationScope activity, except a lot more useful.


When you have different instances of workflows, or even different workflows, that all need to access a shared resource, you are currently limited to using thread level synchronization. If the shared resource access can take a long time, this could imperil the stability of your workflow engine.

For example: you have two workflow instances that both need to update a common file (let's presume for this exercise that updating the file takes 10 minutes) then you will have to somehow tell one of the instances that it has to wait for the other instance. You can do this for example by having them both lock a CriticalSection. This works well as long as you have only a small number of instances, but if for example you create 20 instances that all try to access that same resource, you will find that suddenly your workflow engine is not running any workflows anymore. Why? Because the workflow engine uses a limited thread pool, and now all those threads are busy waiting for that critical section. Not good.
Aha, you say, isn't that what the SynchronizationScope activities for! Well, only if you can somehow rewrite your system to run everything in one single workflow instance, because that is the only case that SynchronizationScope handles.

This project is for developing an activity that can synchronize workflow activities across instances, so you can have shared resources without having multiple threads waiting for some synchronization point.

The current version accomplishes this for a workflow engine that doesn't require its state to be persisted, or more precisely, you cannot shut down the workflow engine while there are any active synchronization activities. Future developments needs to address the state saving problem.

Last edited Jul 3, 2008 at 6:28 PM by leblonk, version 5