Author: miguel
Date: 2005-05-05 01:25:11 -0400 (Thu, 05 May 2005)
New Revision: 44063
Modified:
branches/mono-1-1-7/mono/man/mono.1
branches/mono-1-1-7/mono/mono/metadata/ChangeLog
branches/mono-1-1-7/mono/mono/metadata/threadpool.c
Log:
Apply r44061, r44062 from trunk
Modified: branches/mono-1-1-7/mono/man/mono.1
===================================================================
--- branches/mono-1-1-7/mono/man/mono.1 2005-05-05 05:04:48 UTC (rev 44062)
+++ branches/mono-1-1-7/mono/man/mono.1 2005-05-05 05:25:11 UTC (rev 44063)
@@ -454,8 +454,9 @@
will store the ".wapi" directory in the users's home directory.
.TP
.I "MONO_THREADS_PER_CPU"
-Sets the maximum number of threads in the threadpool per CPU. The default is
-50 for non-windows systems and 25 for windows.
+The maximum number of threads in the general threadpool will be
+20 + (MONO_THREADS_PER_CPU * number of CPUs). The default value for this
+variable is 5.
.TP
.I "MONO_TRACE"
If set, enables the System.Diagnostics.DefaultTraceListener, which will
Modified: branches/mono-1-1-7/mono/mono/metadata/ChangeLog
===================================================================
--- branches/mono-1-1-7/mono/mono/metadata/ChangeLog 2005-05-05 05:04:48 UTC
(rev 44062)
+++ branches/mono-1-1-7/mono/mono/metadata/ChangeLog 2005-05-05 05:25:11 UTC
(rev 44063)
@@ -1,3 +1,8 @@
+2005-05-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+ * threadpool.c: changed the default number of threads per cpu. From now
+ on, the default will be 20 + (5 * number of cpus) instead of 50.
+
2005-05-04 Zoltan Varga <[EMAIL PROTECTED]>
* loader.c (mono_method_get_signature_full): Add locking here.
Modified: branches/mono-1-1-7/mono/mono/metadata/threadpool.c
===================================================================
--- branches/mono-1-1-7/mono/mono/metadata/threadpool.c 2005-05-05 05:04:48 UTC
(rev 44062)
+++ branches/mono-1-1-7/mono/mono/metadata/threadpool.c 2005-05-05 05:25:11 UTC
(rev 44063)
@@ -15,11 +15,10 @@
#ifdef PLATFORM_WIN32
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
-#define THREADS_PER_CPU 25
-#else
-#define THREADS_PER_CPU 50
#endif
+#define THREADS_PER_CPU 5 /* 20 + THREADS_PER_CPU * number of CPUs */
+
#include <mono/metadata/domain-internals.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/threads.h>
@@ -54,9 +53,9 @@
#undef EPOLL_DEBUG
/* maximum number of worker threads */
-static int mono_max_worker_threads = THREADS_PER_CPU;
-static int mono_min_worker_threads = 0;
-static int mono_io_max_worker_threads = THREADS_PER_CPU * 2;
+static int mono_max_worker_threads;
+static int mono_min_worker_threads;
+static int mono_io_max_worker_threads;
/* current number of worker threads */
static int mono_worker_threads = 0;
@@ -732,6 +731,9 @@
g_assert (data->pipe [0] != INVALID_SOCKET);
closesocket (srv);
#endif
+ mono_io_max_worker_threads = mono_max_worker_threads / 2;
+ if (mono_io_max_worker_threads < 10)
+ mono_io_max_worker_threads = 10;
data->sock_to_state = g_hash_table_new (g_direct_hash, g_direct_equal);
@@ -929,13 +931,13 @@
ares_htable = mono_g_hash_table_new (NULL, NULL);
job_added = CreateSemaphore (NULL, 0, 0x7fffffff, NULL);
GetSystemInfo (&info);
- if (getenv ("MONO_THREADS_PER_CPU") != NULL) {
- threads_per_cpu = atoi (getenv ("MONO_THREADS_PER_CPU"));
+ if (g_getenv ("MONO_THREADS_PER_CPU") != NULL) {
+ threads_per_cpu = atoi (g_getenv ("MONO_THREADS_PER_CPU"));
if (threads_per_cpu <= 0)
threads_per_cpu = THREADS_PER_CPU;
}
- mono_max_worker_threads = threads_per_cpu * info.dwNumberOfProcessors;
+ mono_max_worker_threads = 20 + threads_per_cpu *
info.dwNumberOfProcessors;
}
MonoAsyncResult *
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches