[ 
https://issues.apache.org/jira/browse/DERBY-2911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524559
 ] 

Kristian Waagan commented on DERBY-2911:
----------------------------------------

I think the main issue is that the JUnit framework (for instance the runner) is 
not aware of threads spawned from the test method.
If you don't code the waiting for the spawned threads into your test method, 
JUnit will just complete and continue/exit - possibly terminating your threads 
if the test is the last test to be run. 
Second, you don't have any reporting, monitoring or controlling capabilities 
for the threads.

If you write your test method appropriately (some approaches used are 
Thread.join() or features from the java.util.concurrent package in Java SE 
5.0), I think you would be okay. You would just not have any "support 
functions" from the framework, and would have to do everything yourself.
There are also a few libraries for writing multithreaded JUnit tests out there 
(GroboUtils, the TestDecorator approach, maybe more?).

Other test frameworks, for instance TestNG, have the possibility to specify how 
many parallel threads that are running a test method (not to be mixed up with 
the support to run tests in parallel, taking things like dependencies into 
account). It is not quite clear to me how success/failure is measured, or how 
the timeout feature is implemented.

> Implement a buffer manager using java.util.concurrent classes
> -------------------------------------------------------------
>
>                 Key: DERBY-2911
>                 URL: https://issues.apache.org/jira/browse/DERBY-2911
>             Project: Derby
>          Issue Type: Improvement
>          Components: Performance, Services
>    Affects Versions: 10.4.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d2911-1.diff, d2911-1.stat, d2911-unused.diff, 
> d2911-unused.stat, d2911perf.java
>
>
> There are indications that the buffer manager is a bottleneck for some types 
> of multi-user load. For instance, Anders Morken wrote this in a comment on 
> DERBY-1704: "With a separate table and index for each thread (to remove latch 
> contention and lock waits from the equation) we (...) found that 
> org.apache.derby.impl.services.cache.Clock.find()/release() caused about 5 
> times more contention than the synchronization in LockSet.lockObject() and 
> LockSet.unlock(). That might be an indicator of where to apply the next push".
> It would be interesting to see the scalability and performance of a buffer 
> manager which exploits the concurrency utilities added in Java SE 5.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to