PDA

View Full Version : Forking 2 children in Python



BlackSwordD2
March 28th, 2010, 02:25 AM
i need one parent with 2 children in python. and i keep having issues especially with variables not being global.

also, is it better to use threads or forks? (as of right now im using forks and in linux)

slavik
March 28th, 2010, 09:24 AM
depends, are you looking for truly concurrent threads?

Happyfase
March 28th, 2010, 09:27 AM
<off topic>

Thought of something completely different when I read the title of this thread.

ic3man5
March 28th, 2010, 09:37 AM
Like slavik said, it depends if you need true concurrent threads. Without looking at some code or errors we can't help you too much. Another option would be to use the subprocess module and do your communication through the pipe or sockets. If you don't need concurrent threads, Python threads would probably be the way to go.
(http://ubuntuforums.org/member.php?u=67597)