support for infinite cycle generation

This commit also includes early termination support
by breaking the generation procedure. The termination
reacts to POSIX SIGINT.