But here "function1" and "function2" are not processing just for every record. they are processing first record and then join the results to second record after processing and so on...so in short i cannot kill the process while returning to start of the loop.