Skip to content
This repository has been archived by the owner on May 2, 2019. It is now read-only.

Task.Delay cause tox offline #26

Open
randoms opened this issue Jun 7, 2017 · 0 comments
Open

Task.Delay cause tox offline #26

randoms opened this issue Jun 7, 2017 · 0 comments

Comments

@randoms
Copy link

randoms commented Jun 7, 2017

In tox loop.

while (_running)
{
      if (_cancelTokenSource.IsCancellationRequested)
          break;

      int delay = DoIterate();
      await Task.Delay(delay);
}

Task.Delay was used to sleep for some time. But if the threads in thread pool are not enough, it will take 500ms to create a new thread. This may cause tox offline. I recommend to use Thread.sleep instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant