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

Xin Liu xliu at openjdk.java.net
Sun May 16 17:40:46 UTC 2021


> This patch provides a buffer to store asynchrounous messages and flush them to
> underlying files periodically.

Xin Liu has updated the pull request incrementally with three additional commits since the last revision:

 - refactor code and update per reviewers' feedback.
   
   1. change classname from logAsyncFlusher to logAsyncWriter.
   2. completely remove Terminate(), which is not safe.
   3. refactor Initialize() and ensure it can handle concurrent synchronuous logging writers.
   4. refactor gtest. make sure the 1st parameter of EXPECT/ASSERT is the epxected value.
   5. add a GTestWrapper in jtreg, which ran the gtest in async mode.
 - Replace Mutex with Semaphore.
   
   Use 2 sempahores to replace the Monitor*.
   Monitor in hotspot is combination of pthread_mutex_t and pthread_cond_t.
   _lock has the initial value 1. it acts as a 'mutex'.
   _sem has the initial value 0, which denotes how many messages have enqueued.
 - Refactor Initialize() and Termiante().
   
   Define they are 2 synchronization points. async logging exclusively takes
   over from synchronous logging between 2 points.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3135/files
  - new: https://git.openjdk.java.net/jdk/pull/3135/files/7df8b1ed..e19e90a8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3135&range=14
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3135&range=13-14

  Stats: 926 lines in 15 files changed: 400 ins; 452 del; 74 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3135.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3135/head:pull/3135

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


More information about the hotspot-dev mailing list