Python Forum
multiprocessing: when does fork really happen?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiprocessing: when does fork really happen?
#1
i am using the multiprocessing module on a Unix-like platform to run a bunch of worker processes. i am using a system level pipe (os.pipe() is called) to capture stdout output from each child (is there a better way?). with the multiprocessing module, a call to Process is followed by a call to process object start() method. the parent needs to os.close() its copy of the write end of the system level pipe while the child needs to close its copy of the read end. the closes need to happen only after the fork() system call is done. the documentation does not indicate when this actually happens. there is a possibility of the fork() syscall happening after the start() method is called. the calls to os.close() absolutely must not be done before fork() is called.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Chinese coding language ‘Mulan’ found to be Python fork buran 0 1,696 Jan-22-2020, 04:30 AM
Last Post: buran
  libmdbx, prod-ready fork of LMDB: someone can wrap it for python? genryrar 5 5,095 Jun-28-2018, 08:22 PM
Last Post: erthink

Forum Jump:

User Panel Messages

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