Actually I do not mean a shell background process like using a "&". I run into a situation that I want to create another process for preparing data (class_data) and a process for computing (class_process). As the (class_data) can generate while (class_process) is processing. I wanna to subclass a thread class just like in java. I just want to the (class_data) to run asynchronous. A sketch maybe as follows:
class_data.init_generate()
for i in range(100):
class_data.generate()
class_process.process(class_data.data)
class_data.collect()
The generate method may generate a batch data and the collect just wait for the data to be generated and renew the class_data.data to the newly generated.
I am not sure whether I make myself clear, and thanks in advance!