I want to take C/C++ source file from users and I then I will make executable of them using gcc command in linux. And then I will provide input to this executable and redirect the output to another file. And I have a sample output file with which I will check the produced output to take decision regarding wrong or correct answer. In a word I want to make online judge wesite.
But I do not know how to handle infinite loops problem provided by user. Like let a user has submitted the following code..
while(1){
}
I know there will be a lot more threats but how do I handle those problem. I want to know how to people make online judge websites like uva online judge or others. If anybody of you have idea please help me.