I am using Manager in python multiprocessing, Since a manager started , a subprocess is spawned, How can I get the pid of the subprocess? THX
Asked
Active
Viewed 986 times
3
-
Show us your (minimal) code. – John Zwinck Nov 12 '13 at 11:14
-
There are a few suggestions on [this](http://stackoverflow.com/questions/3332043/obtaining-pid-of-child-process) thread. – tijko Nov 12 '13 at 11:40
1 Answers
1
Too late an answer for user1221244, but something that could help future readers of this thread:
As of PY361, the PID of the Manager() instance could possibly be obtained as demoed in the code below:
import multiprocessing;
if __name__ == '__main__':
Mngr = multiprocessing.Manager();
print('Manager process Pid:', Mngr._process.ident);
Note though that because the above involves access to a object marked as private (_process), it might change in future releases.

Snidhi Sofpro
- 479
- 7
- 10