I am developing application that performs a series a calculation jobs for transportation planning. The application can be run, either as part of a desktop application
or as a standalone WCF service. The main bulk of the work is carried out by a COM component written in unmanaged C++, but the all the data handling and the user I/O are written in C#.
I am using .NET 4 and the
statement to start the calculation jobs and this works fine when a run it as a desktop application, but when I run as a WCF service, the calculation jobs are executed sequentially.
I have tried to change the apartment threading model from MTA to STA using a custom Tasks Scheduler as described by Stephen Toub in