I wrote a program that automatically grades programming assignments submitted from students. Reflection is used to load classes and instantiate objects. Unintentional infinite loops are a common mistake in student assignments. A thread is assigned to each student submission. A monitor keeps track of the threads' running time and uses the stop()
method to terminate threads that exceed the maximum time allowed. My program is working as intended, but the stop()
method in java.lang.Thread
is deprecated. I would greatly appreciate advice on a cleaner solution.
Thank you.
stop()
in java.lang.Thread
was deprecated for good reasons: it didn't always work and could interfere with the workings of the JVM.
Your best bet is to run the programs in separate JVMs. You can then kill the processes if you need to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With