This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.