Hi Andreas
The issue I see is with my dual core, where a thread updating the latch is
not seen from another thread. The concurrency of 4 is reached if you put a
sout, but the latch update is not visible to the main thread. This is due to
the Java memory model AFAIK

This would mean that either CountDownLatch is not used correctly in
MinConcurrencyTest or that there is a bug in CountDownLatch, which is
very improbable. Can you exclude the possibility that
concurrencyReachedLatch.await simply times out too early?
This infact is strange.. I looked into this again, and it seems like the original code has some unknown impact on the rest of the behavior.. the test consistently passes with the new code, whereas it intermittently fails with the original code. If you use the old code and just take out the use of latches, and use a sout, you always see 4 messages being received immidiately

asankha

--
Asankha C. Perera
http://adroitlogic.org

http://esbmagic.blogspot.com

Reply via email to