[ThreadPool] Allow heavier initialization when using --server flag #725
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create on demand up to min_threads to avoid startup penalty, avoiding
throttling of threadpool worker thread creation (for now, using
a --server flag) at initialization.
When throttling happens, operations such as parallel https requests were
slowed down significantly due to all of the threads created in order
to complete the SSL operations.
Based on @kamalaboulhosn's pull request (#640), addressing Miguel's comment.
(Tried putting the gboolean variable in mini.c/mini.h, but this didn't work, as it would cause this compilation error:
make[3]: Entering directory
/home/knocte/Documents/Code/mymono/mono/metadata' CC libmonoruntime_la-mono-config.lo CC libmonoruntime_la-threadpool.lo In file included from threadpool.c:22:0: ../../mono/mini/mini.h:52:2: error: #error "The code in mini/ should not depend on these defines." make[3]: *** [libmonoruntime_la-threadpool.lo] Error 1 make[3]: Leaving directory/home/knocte/Documents/Code/mymono/mono/metadata'make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
/home/knocte/Documents/Code/mymono/mono' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/knocte/Documents/Code/mymono'make: *** [all] Error 2
So I moved it to mono-config.)