Reputation: 13
I want to do something like:
Task.Run(while(true)
{
doSomething()
}
Is there a proper way of doing this?
Upvotes: 0
Views: 1107
Reputation: 49
You might want to add some other options.
The task creation option should indicate that this is a long running thread.
You may want to include a task cancellation token to allow this thread to terminate.
Upvotes: 1