Today, asynchronous UL depends on off-loading the work of logging to output devices by having log sites copying messages onto a buffer and an output thread swapping it with an empty buffer and emptying it. If the current buffer runs out of room, then any attempt at logging leads to the message being dropped, that is: The message is not printed at all. I'd like to suggest that we add a stalling mode to async UL where in no message dropping occurs and all log sites stall until there is sufficient room in the buffer for their respective message.
I imagine that the user facing change for async UL would be to equip -Xlog:async with an option, as such:
```
$ java -Xlog:async:drop ... # Drop messages
$ java -Xlog:async:stall ... # Stall log sites
$ java -Xlog:async ... # Drop messages by default
```
This can be implemented by slightly altering the protocol for the producer threads and the consumer threads, whilst retaining the current ping-pong buffer implementation.
I imagine that the user facing change for async UL would be to equip -Xlog:async with an option, as such:
```
$ java -Xlog:async:drop ... # Drop messages
$ java -Xlog:async:stall ... # Stall log sites
$ java -Xlog:async ... # Drop messages by default
```
This can be implemented by slightly altering the protocol for the producer threads and the consumer threads, whilst retaining the current ping-pong buffer implementation.
- links to
-
Review(master) openjdk/jdk/17757
-
Review(master) openjdk/jdk/22770