Revert "Revert "separating the gen routine into a different process, use OS's preemptive scheduling to avoid long response time when phantom is working""

This reverts commit 3fb01739844a88c9bcd7a6ae328995ef96eab273.