Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiprocessing
#1
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()
Reply
#2
Yeah, you call p.join(), which blocks the main thread until the process finishes, which sounds like the opposite of what you want.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020