Skip to content
Advertisement

Tag: infinite-loop

How to exit infinite JS execution loop when reading/loading Javascript in Java using GraalVM?

I found sandbox options as a way to set sandbox.MaxCPUTime in the graalVM documentation, to limit how long the thread runs – https://www.graalvm.org/reference-manual/embed-languages/ I’ve tried the following code – This has been failing for me with the error – Is there a better way to achieve this or a way I can make these sandbox options work? Answer You may

Java infinite loop performance

I have a Thread that only has to work when a certain circumstance comes in. Otherwise it just iterates over an empty infinite loop: Does it affect the performance when the loop actually does nothing but it has to check if it has to do the calculation every iteration? Only creating a this Thread when needed is not an option

Advertisement