I\'m evaluating the Async CTP.
How can I begin execution of an async function on another thread pool\'s thread?
static async Task Test()
{
// Do some
It's usually up to the method returning the Task
to determine where it runs, if it's starting genuinely new work instead of just piggy-backing on something else.
In this case it doesn't look like you really want the Test()
method to be async - at least, you're not using the fact that it's asynchronous. You're just starting stuff in a different thread... the Test()
method could be entirely synchronous, and you could just use:
Task task = TaskEx.Run(Test);
// Do stuff
t.Wait();
That doesn't require any of the async CTP goodness.