how to create "worker" threads to use the power of multi-core processors?
<p>This is the revised version of my previous question <a href="http://stackoverflow.com/questions/6677321/paralleling-trading-software">Paralleling trading software</a></p>

<p>The code is:</p>

<pre><code>foreach (Strategy strategy in strategies)
{
    strategy.AllTablesUpdated();
    Console.WriteLine("All tables updated in " + sw.ElapsedMilliseconds);
}

...........

public override void AllTablesUpdated()
{
    lock (desiredOrdersBuy)
    ....
</code></pre>

<p>And the output is:</p>

<pre><code>All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 9
All tables updated in 9
All tables updated in 9
All tables updated in 9
All tables updated in 23
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 43
All tables updated in 43
All tables updated in 43
All tables updated in 44
All tables updated in 44
All tables updated in 44
All tables updated in 44
All tables updated in 44
All tables updated in 58
All tables updated in 65
All tables updated in 65
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 87
All tables updated in 95
All tables updated in 111
All tables updated in 111
All tables updated in 111
All tables updated in 136
All tables updated in 153
All tables updated in 153
All tables updated in 171
All tables updated in 171
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
</code></pre>

<p>The issue is - when certain strategy waits for lock to be release other strategies waits too.</p>

<p>I think I should replace <code>lock</code> with <code>Monitor.TryEnter</code> and <code>AllTablesUpdated</code> should return <code>boolean</code> (false if it need to be relaunched because lock was not obtained).</p>

<p>Also I think I need 4-6 parallel threads to execute "AllTablesUpdated" method to use the power of multicore processors. How to create these threads?</p>
