Review request: 8010151 : nsk/regression/b6653214 fails "assert(snapshot != NULL) failed: Worker should not be started"

Daniel D. Daugherty daniel.daugherty at oracle.com
Thu Apr 4 07:08:15 PDT 2013


The comment from Coleen about volatile made me curious so I
looked in src/share/vm/runtime/thread.hpp:

   inline void         set_recorder(MemRecorder* rc) { _recorder = 
(volatile MemRecorder*)rc; }
   volatile MemRecorder* _recorder;

Does her comment also apply to the '_recorder' field? Based on the
cast in set_recorder(), I think so...

Dan



On 4/3/13 4:21 PM, Zhengyu Gu wrote:
> Thanks for pointing it out. Yes, it should be a volatile pointer.
>
> -Zhengyu
>
> On 4/3/2013 2:40 PM, Coleen Phillimore wrote:
>>
>> Is the _snapshot volatile or what it points to is volatile? The code 
>> you have is what it points to.
>>
>> I think you want:
>>
>> *!    static_   _MemSnapshot*   volatile  _snapshot;*
>>
>> Coleen
>>
>> On 04/03/2013 01:59 PM, Zhengyu Gu wrote:
>>> The assertion appears due to snapshot variable still is not visible 
>>> to worker thread, so make snapshot volatile.
>>>
>>> NMT creates snapshot before starting NMT worker thread and the 
>>> snapshot is released by worker thread during shutdown, so the 
>>> assertion should not fail. I can not reproduce the problem 
>>> with/without volatile modifier.
>>>
>>>
>>> Bug: http://bugs.sun.com/view_bug.do?bug_id=8010151
>>> Webrev: http://cr.openjdk.java.net/~zgu/8010151/webrev.00/ 
>>> <http://cr.openjdk.java.net/%7Ezgu/8010151/webrev.00/>
>>>
>>> Test:
>>>   nsk/regression/b6653214  on Windows x64
>>>
>>>
>>> Thanks,
>>>
>>> -Zhengyu
>>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20130404/5adaad1e/attachment.html 


More information about the hotspot-runtime-dev mailing list