RFR: 8267517: async logging for stdout and stderr [v3]

David Holmes dholmes at openjdk.java.net
Tue Dec 21 22:39:19 UTC 2021


On Tue, 21 Dec 2021 22:11:48 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> src/hotspot/share/logging/logAsyncWriter.cpp line 155:
>> 
>>> 153:     // LogFileOutput::write_block() has called fflush().
>>> 154:     // stderr does not cache.
>>> 155:     fflush(stdout);
>> 
>> if `LogFileOutput::write_block() has called fflush()` why are we calling it here?
>
> because `LogFileStreamOutput::write_blocking()` doesn't call fflush(), therefore, we need to do special treat for STDOUT here.

Okay so why does LFO::write_blocking call fflush but LFSO::write_blocking does not? Shouldn't the two methods have the same general semantics?

>> src/hotspot/share/logging/logAsyncWriter.hpp line 31:
>> 
>>> 29: #include "memory/resourceArea.hpp"
>>> 30: #include "runtime/nonJavaThread.hpp"
>>> 31: #include "runtime/semaphore.hpp"
>> 
>> Seems unneeded by the other changes in this file.
>
> We  can't compile without this header file. The definition of Semaphore is needed (145: Semaphore _flush_sem;) and it was drag in from logFileOutput.hpp. 
> 
> This is a cleanup.

Okay.

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

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


More information about the hotspot-runtime-dev mailing list