Sometime we need to update UI from a task. In order to update UI we should run or return result in UI thread. But it seems to impossible since all tasks run on threads provided by ThreadPool. But still, we can achieve updating UI from the task by using synchronization context Task Scheduler. First we will see an approach and then we will...
We all worked with ContinueWith() method but there are some interesting and useful facts we should be aware of. First of all lets remember what is Continuation regarding the Tasks. When we looking for this definition in MSDN , we see following: Creates a continuation that executes asynchronously when the target Task completes. Lets see an example: Task task1 = Task.Factory.StartNew(() => Console.Write ("creating...
Developers can define parent-child relationships between task. The main idea is, parent task is completed when all its children tasks are completed. Example1: private static void childrenTasksExample() { var parent = Task.Factory.StartNew(() => { Console.WriteLine("Parent...
Lately i was experienced a rough and kinda intense period: a lot of things required my nearly immediate attention and response. It came simultaneously from different life aspects: academic (MSC degree), personal, family,organizational and etc. Neither i was prepared for such pressure, nor i had an idea how to handle all this. At that point i have discovered "task priority" which is one...
Today my point of interest is Thread vs Task. Finally i had a little amount of time between projects to dive deeper in order to "examine" the difference. Actually when you ask people what is the difference you hear a lot of different things but the feeling that this point is not organized enough for me. So i decided to clarify this point...