Hello,

I definitively found the solution to this problem. In fact, there were two 
problems :

1) bug in thread spawning childs, that you corrected in util.popen3 by sending 
a message to the main thread to spawn the childs.

2) when you call popen2 class (and others) with commands in pileline, python 
spawns a child with a shell to start multiple jobs for your pipes : you lose 
the pid of these jobs and can't kill them later. 
I found a workaround by setting the shell child a process group leader. I add 
this line in util.popen3 in Popen4 class in _run_child function : 
"os.setpgid(0, os.getpid())". Now you can kill the whole process tree by 
calling os.kill(-child.pid, signal).
 
Maybe useful to add this in util.popen3 and childapp class for future use...


Cheers,

Nicolas.

 
> On Saturday 24 April 2004 20:14, Nicolas Michaux wrote:
> > Hello,
> >
> > I'm writing my first plugin for freevo : a dvd backup plugin to rip,
> > shrink and burn dvd on dvd-r. It's entirely based on mmpython and can
> > choose video, audio and subtitles streams to rip.
> >
> > Everything is working fine, except the threads handling : I can't find a
> > method to kill entirely my childs...
>
> After 2 weeks of search, I found the reason : there is a bug in python 2.2
> and 2.3 when forking in a thread (it works with python 2.1). The childs
> never get the signals...
> I'm rewriting my code not to use threads...
> I hope I 'll release my plugin this week, with a stopping function!
>
> Have a nice day.
>
>
> Nicolas
>
>
> Note : I think the cdbackup  plugin will have the same problem if you want
> to interrupt the backup process
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
> deliver higher performing products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________
> Freevo-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/freevo-devel


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to