I am starting wpf tasks with the way below
var newTask = Task.Factory.StartNew(() =>
{
fcStartSubPageCrawl(srMainSiteURL, srMainSiteId);
}).ContinueWith((t) =>
{
var aggException = t.Exception.Flatten();
foreach (var exception in aggException.InnerExceptions)
csPages.LogException(exception.ToString());
},
TaskContinuationOptions.OnlyOnFaulted);
Now when i check the task status
like this (new tasks assigned to task list) :
if (tskLocalTaskList[i].IsCompleted == false)
I am seeing that task status = WaitingForActivation
what does this mean ? And why it is waiting activation ?
C# 4.0 WPF
WaitingForActivation is the time the task resides between a call to the Start method and the moment in which the task gets scheduled by the Task scheduler. So directly after a call to the start method of a task, the tasks status is being set to WaitingForActivation and a call to scheduler.AddWork is made. In here, the Task is either scheduler (WaitingToRun) or run immidiatly.
Oh, and this has nothing to do with WPF, Tasks are a part of the BCL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With