Looking for a sponsor to review changes made to two unit tests under jdk/test

Mani Sarkar sadhak001 at gmail.com
Mon Apr 8 10:53:00 UTC 2013


We initially introduced CountdownLatch and now Semaphore, to replace the
Thread.sleep(10) which took place before - what appears to be a forced GC
(am I right?):

             System.err.println("GC " + i);
             System.gc();
             System.runFinalization();

As the threads join at the ends of the other, then we can do away with the
Semaphore but how would we simulate the 10ms pause before the forced GC -
is that necessary? Can we still use Semaphores to implement pauses?

Cheers,
mani

On Mon, Apr 8, 2013 at 11:07 AM, Alan Bateman <Alan.Bateman at oracle.com>wrote:

> On 08/04/2013 10:39, Mani Sarkar wrote:
>
>> Hi David,
>>
>> Here's the version of
>> *jdk8_tl/jdk/**test/java/lang/**ref/Basic.java*implemented using a
>> Semaphore:
>>
>>  Hi Mani,
>
> Is there a handshake really needed here? From a quick look at the test
> then it looks to me that fork (used by createNoise) does a Thread.join so
> it waiting until the task is complete before it returns.
>
> -Alan
>



-- 
*Twitter:* @theNeomatrix369
*Blog:* http://neomatrix369.wordpress.com
*JUG activity:* LJC Advocate (@adoptopenjdk & @adoptajsr programs)
*Meet-a-Project:* https://github.com/MutabilityDetector
*Devoxx UK 2013 was a grand success:*
http://www.devoxx.com/display/UK13/Home
*Don't chase success, rather aim for "Excellence", and success will come
chasing after you!*



More information about the core-libs-dev mailing list