Activate thread synchronically
I'm using .Net 4.0 parallel library. The tasks I execute, ask to run some other task, sometimes synchronously and sometimes asynchronously, depending on some conditi开发者_StackOverflow社区ons which are not known in advanced. For async call, i simply create new tasks and that's it. I don't know how to handly sync call: how to run it from the same thread, maybe that sync tasks will also ask to execute sync tasks recursively. all this issue is pretty new to me.
thanks in advance.
You can just call Task.RunSynchronously()
on it, instead of Task.Start()
.
精彩评论