I am making a website which has
java puzzles like "fill in the missing code".
I am compiling and executing the programs online and displaying the results with respect to some
test cases.
My problem is when a user tries to implement a program which goes into a infinite loop.
eg,
I want to know how I can time out programs while they are executing so I can halt the execution of programs which exceed a certain timeout or my web server will become too slow if such infinite loops are allowed to be compiled.