[Mondrian] Multithreading, Parallel Batch / Query Execution

Ajit Vasudeo Joglekar ajogleka at thoughtworks.com
Thu Apr 19 02:04:14 EDT 2007


Michael,

These blocking statistics are useful to understand how much lock 
contention is happening for a given lock.
"block count" - number of times that any thread(s) had to wait (blocked) 
for getting this particular lock
"block duration" - cumulative blocking time for all threads for this 
particular lock

I think at least initially the cumulative block duration is more useful 
than individual block duration for general optimization. Individual block 
duration could be useful later on to identify thread starvation

> 1) How do you launch a worker thread with no managed threads? My guess 
is a simple new Thread(...).start();  If so this is too simplistic and you 
should see how it works when you have multiple users.  The number of 
threads would go far too high and the overall performance will become 
really bad.

I am using new Thread().start(). It is intentionally kept simple for now. 
Current focus is to understand the benefit of parallel execution, 
bottlenecks and related optimizations in a controlled test environment.

> 2) You can't use ConcurrentHashMap because Mondrian must be able to be 
backported to JDK 1.4 via retroweaver.

Frankly, I haven't explored the alternatives for java 5 
java.util.concurrent. 
http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php and 
http://retrotranslator.sourceforge.net/ together could be a possibility

> 3) Similarly you would need to roll your own reentrant locks.

http://dcl.mathcs.emory.edu/util/backport-util-concurrent/compatibility.php 
seems to support reentrant locks

> 4) The synchronized lazy initialization can always be converted to a 
design pattern that Josh Bloch wrote up:

This is what I had in my mind :)

Thanks for your comments

 -Ajit






michael bienstein <mbienstein at yahoo.fr> 
Sent by: mondrian-bounces at pentaho.org
04/19/2007 05:28 AM
Please respond to
Mondrian developer mailing list <mondrian at pentaho.org>


To
Mondrian developer mailing list <mondrian at pentaho.org>
cc

Subject
Re : [Mondrian] Multithreading, Parallel Batch / Query Execution






Ajit,
 
I have a few of points:
 
First off it is nice to see some real investigation as to bottlenecks.  I 
don't understand the "block count" or "block duration".  I can understand 
cumulative method duration and number of method calls.  How these figures 
would be affected by multiple parallel threads though I don't know since 
the duration of two threads would get added.  Can you enlighten me please 
as to how they are calculated?
 
1) How do you launch a worker thread with no managed threads? My guess is 
a simple new Thread(...).start();  If so this is too simplistic and you 
should see how it works when you have multiple users.  The number of 
threads would go far too high and the overall performance will become 
really bad.
2) You can't use ConcurrentHashMap because Mondrian must be able to be 
backported to JDK 1.4 via retroweaver.
3) Similarly you would need to roll your own reentrant locks.
4) The synchronized lazy initialization can always be converted to a 
design pattern that Josh Bloch wrote up:
 
class MyClass {
    static MyClass getSingleton() {
        return InnerClass.singleton;
    }
 
    private static InnerClass {
        MyClass singleton = new MyClass();
    }
}
 
The Java Language will static initialize in a thread safe way just once.
 
Michael

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 Yahoo! Questions/Réponses.
_______________________________________________
Mondrian mailing list
Mondrian at pentaho.org
http://lists.pentaho.org/mailman/listinfo/mondrian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20070419/da4bbd18/attachment.html 


More information about the Mondrian mailing list