publicstaticvoid run() throws Exception { final Semaphore sem = new Semaphore(0); final Semaphore delay = new Semaphore(0); Thread thr = newThread(() -> { LoopAllocFreeEnv(sem, delay); }, "LoopNative");
thr.start(); // Make sure the other thread is actually started.
sem.acquire();
Trace.enableSingleStepTracing(Test1941.class,
Test1941.class.getDeclaredMethod( "notifySingleStep", Thread.class, Executable.class, Long.TYPE),
thr);
setTracingOn(Thread.currentThread(), true); // Don't let the other thread start actually running until we've started // tracing this thread too in order to ensure that the (formerly) racy // behavior can happen.
delay.release();
System.out.println("fib(20) is " + fib(20));
thr.interrupt();
thr.join();
setTracingOn(Thread.currentThread(), false);
Trace.disableTracing(null); if (PRINT_CNT) {
System.out.println("Number of envs created/destroyed: " + CNT);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.