Python Forum

Full Version: Multiprocessing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a function self.load_dataframe(0). when it is called from in its Frame parent, it will freeze the Frame until it returns value to self.df. I try to run it in another process like below. But not working. Is it something wrong? Thanks.

from multiprocessing import Process

# Replace
self.df = self.load_dataframe(0)
# with
p = Process(target=self.load_dataframe, args=(0))
self.df = p.start()
p.join()
Yeah, you call p.join(), which blocks the main thread until the process finishes, which sounds like the opposite of what you want.