In C# I have two blocks of code which open and write to processes which I open and I'd like them to run at the same time in the same function. I found BackgroundWorker with anonymous methods? but when i tried to impliment the it doesn't run the code in the lambda expression.
BackgroundWorker bgwanalysis = new BackgroundWorker();
bgwanalysis.DoWork += delegate
{
...codehere..
};
while (bgwanalysis.IsBusy)
{
Thread.Sleep(2000);
}
I know I'm missing something basic could someone fill me in? Thanks