<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2>I agree with the sentiment regarding threads. If we
implement #2 (parallel SQL query execution) I want mondrian to be able to run in
a mode where everything is done in one thread.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2>(If you read my blog post <A
href="http://julianhyde.blogspot.com/2006/12/its-not-often-that-i-am-criticized-for.html">What's
in a name</A>, you will know that I am militantly agnostic on whether
mondrian is a server. A repository is one sure sign that a software library is
growing into a server, but a thread pool is another.) </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2>When we do allocate threads, we will use
java.util.concurrent.ThreadFactory - that should give enough flexibility for
various environments. (I have a feeling that ThreadFactory was introduced
because people wanted a safe way to create threads inside their EJBs, so we can
use if for the same purpose.)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2>I want to challenge Michael's assertion that "<FONT
face="Times New Roman" color=#000000 size=3>almost no JDBC driver will allow
parallel queries</FONT>". It may be true, but if so, it will cost us a lot of
effort to do things another way, so I want to see some evidence. Michael, can
you give an example of a JDBC driver which cannot execute two statements in
the same connection (and transaction context)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2>Julian</FONT> </SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org
[mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>michael
bienstein<BR><B>Sent:</B> Tuesday, February 13, 2007 2:08 PM<BR><B>To:</B>
Mondrian developer mailing list<BR><B>Subject:</B> Re : [Mondrian]
Multi-threading SQL execution<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">Matt,<BR><BR>The
reason that threads shouldn't be created in Servlets is conceptually
simple. Servlets run in a managed environment. The control over
the usage of system resources should be handled by the environment without
interference from applications being managed. Threads are one of those
resources. To give an idea of this, there is actually no restriction on
the number of Threads you create in Java. However if you go over 8
threads per CPU you get serious performance degradation because of the
switching the CPU has to do between the threads (at least on Windows Sun JDK
1.4). So it's better if you set up your application server and configure
how many threads get used for all the applications in the same JVM and no
application changes this.<BR><BR>More generally, Java has very bad semantics
for enforcing this sort of control over system resources. Consider
memory. I didn't know that Java 5 allowed some control over this as
Richard has shown us recently. Look at the problems though: Derby runs
in the same JVM as Mondrian and all of a sudden we get lots of failures
because we are told that we're running out of memory. How can you limit
how much memory a WAR can use? You can't. With File access you
probably could do it with a custom SecurityManager. With Threads that's
probably true too, but no major app server does it.<BR><BR>The second reason
has nothing to do with Mondrian. EJB 1 and 2 focussed on being able to
call business logic without worrying about where that logic was
implemented. It could be in a different JVM or even on another
computer. Using threads (or static variables) is therefore forbidden
even though if you know you are only running locally then it will still all
work.<BR><BR>Lastly, I know commercial BI software that *breaks* this rule and
launches a thread in a Servlet init() method. It is truly astounding how
many bad things pop up when the language or framework doesn't constrain
you.<BR><BR>Michael<BR><BR>PS: Congrats on 2.3 feature complete. Really
happy to see cache flushing in there. But did Bart's bug on virtual cube
get fixed? I'm really curious as to what causes it.<BR></DIV></DIV><BR>
<HR SIZE=1>
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes
sur <A
href="http://fr.rd.yahoo.com/evt=42054/*http://fr.answers.yahoo.com">Yahoo!
Questions/Réponses</A>.</BLOCKQUOTE></BODY></HTML>