I'am making an application in C# .Net 4.5. I am trying to use multithreading, via tasks. I have an array of tasks that I get to run some process. I want the task to return a enumeration which is called enumSignal. However I do not know what to do, the below code is my attempt.
It highlights the line "_taskFactory.StartNew(_indicator[I].Run)" with the message The call is ambiguous between the following methods.
public void RunIndicators()
{
_taskFactory = new TaskFactory();
Task<enumSignal>[] taskIndicator = new Task<enumSignal>[_indicator.Length];
for (int i = 0; i < taskIndicator.Length; i++)
{
taskIndicator[i] = _taskFactory.StartNew(_indicator[i].Run);
}
Task.WaitAll(taskIndicator);
}