Code review request: CR 7141259 Native stack is missing in hs_err
Vitaly Davidovich
vitalyd at gmail.com
Fri Feb 3 14:42:09 PST 2012
How about an instance/non-static decoder which when needing to do symbol
loading obtains a static lock (or semaphore if more than 1 is OK) before
loading symbols and then releases it once the memory is freed? Not pretty
but allows decoder to have its own state (whether locking is needed) but
have global control on how many of them can do the expensive operation.
Maybe have separate impl for elf vs windows where windows impl doesn't
acquire any locks.
Sent from my phone
On Feb 3, 2012 5:13 PM, "Zhengyu Gu" <zhengyu.gu at oracle.com> wrote:
> Hi David,
>
> Thanks for reviewing. I think I made wrong assumption that the thread is
> the last running thread.
>
> 803 // This should be the only running thread, decoder can safely run in
> 804 // single threaded mode without acquiring lock
> 805 Decoder::set_single_threaded(**true);
> 806
>
> To avoid locking in error handler, the only solution I can think of, is to
> have its own private decoder.
>
> Please see revised webrev: http://cr.openjdk.java.net/~**
> zgu/7141259/webrev.01/<http://cr.openjdk.java.net/~zgu/7141259/webrev.01/>
>
> Later when there are multiple users of the Decoder I don't know how you
>> will fix this because those other users can run concurrently with
>> report_and_die(). That said I'm unclear what it is about the Decoder that
>> requires locking - what state does it maintain? Is there a reason not to
>> create a Decoder only when needed?
>>
>> Decoder is created on demand, but would prefer to be shared, since it
> can consume noticeable amount memory on Unix platform, by loading Elf
> files' symbol tables and string tables into memory (not impact on Windows).
> The lock is needed to protect a linked list structure in Elf decoder, or
> current file position.
>
> Thanks,
>
> -Zhengyu
>
>> ---
>>
>> In decoder.cpp you can still use MutexLockerEx and as it will take a null
>> mutex and just act as a no-op eg:
>>
>> MutexLockerEx locker( _single_thread ? NULL : _decoder_lock, true);
>>
>> Cheers,
>> David
>> -----
>>
>>
>>> Please review
>>> Webrev: http://cr.openjdk.java.net/~**zgu/7141259/webrev.00/<http://cr.openjdk.java.net/~zgu/7141259/webrev.00/>
>>>
>>>
>>> Thanks,
>>>
>>> -Zhengyu
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20120203/ed106f4e/attachment.html
More information about the hotspot-dev
mailing list