RFR: 8229517: Support for optional asynchronous/buffered logging [v11]
Xin Liu
xliu at openjdk.java.net
Fri May 7 09:09:56 UTC 2021
On Thu, 6 May 2021 15:20:17 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> The base class is unaware of the fact that you keep track of the list tail here. If used incorrectly (eg calling base class removal functions) you could damage this structure, because the tail node gets removed.
LinkedListDeque "private" inherits LinkedListImpl. They are not 'is-a' relationship. LinkedListDeque just borrows some code from LinkedListImpl in its implementation. Client can't sabotage "deque" integrity using LinkedList's API.
Actually, my design target is a generic deque based on linkedlist. Linked list can give me pop_all() in O(1). you can think it of a smart `swap`.
I acknowledge that problem you described. That's the cost to use ADT(Abstract Data Type). Even STL containers sometimes are cumbersome. I would like to hear other reviewers opinions about this. Shall I customize my own data structure or try to use ADT?
I have fixed most issues in linkedlist.hpp in prior commits. If @kimbarrett allows me to use move constructor, I can even remove `AsyncLogMessage::destroy`, which is just compromise to avoid copying.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3135
More information about the hotspot-dev
mailing list