db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Zeigermann <oliver.zeigerm...@gmail.com>
Subject [transation][all] Tiny concurrency testing class
Date Fri, 17 Dec 2004 12:34:45 GMT
Folks,

I know this is nothing new, but I have just created a tiny class that
helps you make concurrent scenarios deterministic. This is very useful
for testing where you want to have a contious flow throughout
different threads. The idea is to have an ordered sequence of numbers
where n can not be executed before n-1 has not been:

Here are the API docs

http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/util/CounterBarrier.html

and here are the sources

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/transaction/src/java/org/apache/commons/transaction/util/CounterBarrier.java?rev=1.1&view=markup

As an example have a look at the testPreference() method in

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/transaction/src/test/org/apache/commons/transaction/locking/GenericLockTest.java?rev=1.4&view=markup

Getting the same sutff done with synchronized blocks is something that
will make you need medical attendance very soon.

Hope I am not already getting on anybodies nervers with me stuff and cheers,

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message