This is probably an easy and dumb question. I create a task as follows:
Task<bool> myTask = new Task<bool>(() => { Debug.WriteLine("Task fired"); return true; });
// I know I can create it with Task.Run, but this is for purpose of the sample
myTask.Start();
and I have few questions about this:
- Does it always work in ThreadPool thread?
- If it runs on ThreadPool, is it likely that it will be launched by the user interface thread? And in the case of working with bey - can block it?
- In the case of a large number of tasks, can several be assigned to one thread (in the queue), and then run one after another? Or does each task have its own thread?
I read some documentation, but I did not find specific explanations. For example, Task Documentation usually talks about tasks:
Since the work performed by the Task object is usually performed asynchronously in the thread pool thread, and not synchronously in the main application thread ...
source
share