RFR: 8229517: Support for optional asynchronous/buffered logging [v19]

Xin Liu xliu at openjdk.java.net
Mon May 24 02:04:58 UTC 2021


On Sat, 22 May 2021 21:35:50 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update according to reviewers' feedback (Part-2).
>
> src/hotspot/share/logging/logAsyncWriter.hpp line 137:
> 
>> 135: class AsyncLogWriter : public NonJavaThread {
>> 136:   static AsyncLogWriter* _instance;
>> 137:   // _sem is a semaphore whose value denotes how many messages have been enqueued.
> 
> "how many messages have been enqueued" seems to suggest it's a monotonically growing number as new message are enqueued. In fact, this number will decrease as `_buffer` is flushed. Maybe "_sem denotes the number of messages in _buffer` and moving the two together?

The value of _sem denotes the number of messages have been enqueued.  It's actually different from "the number of messages in _buffer".  When  _sem.wait() returns, it just increases one.  however, _buffer.pop_all() pops all messages in queue at once.   The two numbers are not consistent all the time. 

> Maybe "_sem denotes the number of messages in _buffer` and moving the two together?

Could you elaborate this?  thanks?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3135


More information about the hotspot-dev mailing list