Skip to content

Instantly share code, notes, and snippets.

@laixintao
Created Feb 14, 2020
Embed
What would you like to do?
import os
parent_pid = os.getpid()
print("parent pid: ", parent_pid)
forked_pid = os.fork()
print("forked_pid: ", forked_pid)
parent_pid = os.getpid()
print("my pid: ", parent_pid)
@laixintao

This comment has been minimized.

Copy link
Owner Author

@laixintao laixintao commented Feb 14, 2020

parent pid:  91621
forked_pid:  91622
my pid:  91621
forked_pid:  0
my pid:  91622

...output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment