RFR: 8286180: Enable construction of LogStreamImpl from LogMessageImpl [v5]
Johan Sjölén
duke at openjdk.java.net
Mon May 23 10:31:07 UTC 2022
On Mon, 23 May 2022 07:00:48 GMT, David Holmes <dholmes at openjdk.org> wrote:
> The code looks reasonable just reading through the changes, but I'm missing something fundamental here. We have:
>
> `class NonInterleavingLogStream : public LogStreamImpl<LogMessageHandle>`
>
> and
>
> `class LogStream : public LogStreamImpl<LogTargetHandle>`
>
> but I can't tell what makes the former "non-inter-leaving" while the latter is "inter-leaving" , nor do I understand the test cases for these.
>
> Thanks.
@dholmes-ora
`LogMessageHandle` and `LogTargetHandle` provides different guarantees. The former guarantees that all lines are logged without interleaving and the latter does not guarantee this. The former takes a bit more memory, so it's sometimes preferable to use the latter.
The tests `(Non)InterleavingStream` show that the output order differs between the two log streams. For the non-interleaving log stream the `log_info()` calls are all lumped together at the start, because the stream messages will be flushed together. This is not the case for the `InterleavingStream` test where the `log_info()` messages interleave with the stream messages.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8748
More information about the hotspot-runtime-dev
mailing list