RFR: 6669: FlameGraphView tree calculation should (probably) be interruptable [v5]
Miroslav Wengner
mwengner at openjdk.java.net
Fri Oct 23 14:25:52 UTC 2020
On Fri, 23 Oct 2020 12:08:33 GMT, Marcus Hirt <hirt at openjdk.org> wrote:
>> Miroslav Wengner has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 6669: correction
>
> application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java line 392:
>
>> 390: if (!modelRebuildRunnableList.isEmpty()) {
>> 391: modelRebuildRunnableList.get(activeModelRebuildThread).setInvalid();
>> 392: activeModelRebuildThread = (activeModelRebuildThread + 1) % MODEL_EXECUTOR_THREADS_NUMBER;
>
> You don't need to keep track of the threads, do you? You just need to keep track of the latest runnable. If you get another request, you simply invalidate the current one (and then you don't care what happens with it, it will worst case continue for a little bit, and then fizzle out), and update the latest to be the one from the newest request.
>
> I.e. the only reason we're having multiple threads, it so that we allow the discovery of the cancellation to take a little bit of time, during which we can already get going with the next one. There is only ever one calculation that will have a result we care about, and that is the latest one submitted.
correct, we don't need a references as the only valid one is the last one. We have stages and only the last active sample set is displayed even when other threads end properly. The thread number is equal stages as during a tests it got the best UI experience working with large samples set.
> application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java line 172:
>
>> 170: private ModelState modelState = ModelState.NONE;
>> 171: private int activeModelRebuildThread;
>> 172: private List<ModelRebuildRunable> modelRebuildRunnableList = new ArrayList<ModelRebuildRunable>(
>
> Runnable with two n's.
corrected!
-------------
PR: https://git.openjdk.java.net/jmc/pull/135
More information about the jmc-dev
mailing list