Hi Gary,
Sorry about the delay in the review. Been trying to fully understand all the various code flows, which is tricky due to having the separate event thread whose output needs to be co-ordinated with command thread. Also made more complicated by the multiple entrypoints into executeCommand(), and there being various places where output produced and we care about the order. I think I have it all mapped out now and a pretty good understanding of how it all works. My first impression is that it seems like a large number of changes and a lot of passing around of a StringBuffer object to fix a problem which I think could be resolved with some strategic wait/notify code. For example, it might be as simple as doing something like this: http://cr.openjdk.java.net/~cjplummer/8169718/webrev.00/ This only covers the step command. You'd have to figure out which other commands need to ensure an event has been processed before printing the prompt, and set waitForEventCompletion = true for them. Is there a reason not to go with something like this? As for you current changes, just a couple of things I've noticed, but I have not given it a thorough review (for example, making sure that the StringBuffer is always eventually printed, and done so in the right order). In EventHandler.run(), it's unclear who is handling the printing of sb when handleEvent() or handleDisconnectedException() are called. In the following EventHandler code: 123 @Override 124 public void stepEvent(StepEvent se, StringBuilder sb) { 125 Thread.yield(); // fetch output 126 sb.append(MessageOutput.format("Step completed:")); 127 } Do you understand why the Thread.yield() is there? What does the comment mean by "fetch output"? Just seems like it has something to do with the ordering of output, but it seems bad that the code ever relied on a yield to make sure the output was ordered properly. Also in the above code snippet, you need to be careful when replacing MessageOutput.lnprint() with MessageOutput.format(). lnprint() adds a newline to the start of the line. That appears to be missing in your code above. thanks, Chris On 7/20/18 12:11 PM, Gary Adams wrote: Here's another attempt to clear up the overlapping output from
|
- Re: RFR: JDK-8169718: nsk/jdb/loca... Chris Plummer
- Re: RFR: JDK-8169718: nsk/jdb/loca... Gary Adams
- Re: RFR: JDK-8169718: nsk/jdb/... Chris Plummer
- Re: RFR: JDK-8169718: nsk... Gary Adams
- Re: RFR: JDK-8169718:... Chris Plummer
- Re: RFR: JDK-8169718:... Gary Adams
- Re: RFR: JDK-8169718:... Chris Plummer
- Re: RFR: JDK-8169718:... Gary Adams
- Re: RFR: JDK-8169718:... Chris Plummer
- Re: RFR: JDK-8169718: nsk/jdb/locals/locals002:... Gary Adams
- Re: RFR: JDK-8169718: nsk/jdb/locals/local... Chris Plummer
- Re: RFR: JDK-8169718: nsk/jdb/locals/l... Chris Plummer
- Re: RFR: JDK-8169718: nsk/jdb/loca... serguei.spit...@oracle.com
- Re: RFR: JDK-8169718: nsk/jdb/... Chris Plummer
- Re: RFR: JDK-8169718: nsk... serguei.spit...@oracle.com
- Re: RFR: JDK-8169718: nsk... Gary Adams
- Re: RFR: JDK-8169718:... Gary Adams
- Re: RFR: JDK-8169718:... Chris Plummer
- RFR: JDK-8169718: nsk/jdb/locals/locals002: ERR... gary.ad...@oracle.com
- Re: RFR: JDK-8169718: nsk/jdb/locals/local... Gary Adams
- Re: RFR: JDK-8169718: nsk/jdb/locals/l... Alex Menkov