Changeset: d72d9f984c42 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d72d9f984c42
Modified Files:
monetdb5/mal/mal_session.c
Branch: default
Log Message:
MSscheduleClient: add note on thread creation/reuse
thread reuse doesn't gain any performance, so non-issue
diffs (24 lines):
diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c
--- a/monetdb5/mal/mal_session.c
+++ b/monetdb5/mal/mal_session.c
@@ -294,6 +294,20 @@ MSscheduleClient(str command, str challe
MSinitClientPrg(c, "user", "main");
GDKfree(command);
+
+ /* NOTE ABOUT STARTING NEW THREADS
+ * At this point we have conducted experiments (Jun 2012) with
+ * reusing threads. The implementation used was a lockless array of
+ * semaphores to wake up threads to do work. Experimentation on
+ * Linux, Solaris and Darwin showed no significant improvements, in
+ * most cases no improvements at all. Hence the following
+ * conclusion: thread reuse doesn't save up on the costs of just
+ * forking new threads. Since the latter means no difficulties of
+ * properly maintaining a pool of threads and picking the workers
+ * out of them, it is favourable just to start new threads on
+ * demand. */
+
+ /* fork a new thread to handle this client */
if (MT_create_thread(&p, MSserveClient, (void *) c, MT_THR_DETACHED) !=
0) {
mnstr_printf(fout, "!internal server error (cannot fork new "
"client thread), please try
again later\n");
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list