[threadpool-ms] Exit worker thread after 5 to 60 seconds
commit22f0f1596b9160ea911fa43b1dd80cbeeb6b4bdf
authorLudovic Henry <ludovic@xamarin.com>
Wed, 30 Sep 2015 13:25:25 +0000 (30 14:25 +0100)
committerLudovic Henry <ludovic@xamarin.com>
Tue, 6 Oct 2015 13:29:06 +0000 (6 14:29 +0100)
tree9bef02c0cc582c825adadd492b8405c54c514496
parent0056f1ff018a9690a467f66aadae928728d7436f
[threadpool-ms] Exit worker thread after 5 to 60 seconds

The timeout before exiting a worker thread is random to limit the worst case scenario where, if the timeout is set to N seconds, the user would launch a lot of work item simultaneously, at an interval of N + 1 seconds. In this case, we would have to kill all the threads at once, and starts them all over again 1 second later. The randomization makes the creation and destruction more linear in time, and avoid burst.
mono/metadata/threadpool-ms.c