Re: threading troubles

2006-07-12 Thread sreekant
Oh dear. For the time being I will leave it with fork and leave it at that. Ta sree > You may be missing nothing. If I recall correctly a similar problem was > once reported on the pygtk-list. Some investigation showed that some > programs couldn't be reliably run from a thread, using os.system.

Re: threading troubles

2006-07-12 Thread Antoon Pardon
On 2006-07-10, sreekant <[EMAIL PROTECTED]> wrote: > Hi folks > > What am I doing wrong in the following? I just want to run fluidsynth in > the background. > # > class MyThread(threading.Thread): > def __init__(self, cmd, callback): > self.__c

Re: threading troubles

2006-07-11 Thread sreekant
Piet van Oostrum wrote: >> sreekant <[EMAIL PROTECTED]> (S) wrote: > >> S> I decided in the end to use fork and all is well. > > But how are you doing the callback then? From your code it looks like the > callback is called after the external command finishes. The callback would > then be cal

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
> sreekant <[EMAIL PROTECTED]> (S) wrote: >S> I decided in the end to use fork and all is well. But how are you doing the callback then? From your code it looks like the callback is called after the external command finishes. The callback would then be called in the child process, not in the

Re: threading troubles

2006-07-11 Thread sreekant
I decided in the end to use fork and all is well. Thanks sree -- http://mail.python.org/mailman/listinfo/python-list

Re: threading troubles

2006-07-11 Thread Piet van Oostrum
> sreekant <[EMAIL PROTECTED]> (S) wrote: >S> Hi folks >S> What am I doing wrong in the following? I just want to run fluidsynth in >S> the background. >S> # >S> class MyThread(threading.Thread): >S> def __init__(self, cmd, callback): >S> sel

Re: threading troubles

2006-07-10 Thread [EMAIL PROTECTED]
sreekant wrote: > Hi folks > > What am I doing wrong in the following? I just want to run fluidsynth in > the background. Others have pointed you at os.popen. In non-crippled languages, use processes (e.g. popen) when you wish to preserve the years of hard work that OS designers put into protecte

Re: threading troubles

2006-07-10 Thread sreekant
Hi there I tried as advised. Now the function gets called only after I hit quit button which calls gtk.main_quit() at which point, the ui stays on but not responsive, while the fluidsynth runs in the fg, then ui disappears as the fluidsynth finishes and presumably the thread dies. xc = thread

Re: threading troubles

2006-07-10 Thread faulkner
you don't need twisted to run processes in the background, either. os.popen* returns a file or set of files representing std streams immediately subprocess.Popen is a spiffy little object new in 2.4 and available for download for 2.3. check the module docstrings for usage tips. you can use threads

Re: threading troubles

2006-07-10 Thread Jean-Paul Calderone
On Mon, 10 Jul 2006 11:29:37 +, sreekant <[EMAIL PROTECTED]> wrote: >Hi folks > >What am I doing wrong in the following? I just want to run fluidsynth in >the background. ># >class MyThread(threading.Thread): > def __init__(self, cmd, callback): >

threading troubles

2006-07-10 Thread sreekant
Hi folks What am I doing wrong in the following? I just want to run fluidsynth in the background. # class MyThread(threading.Thread): def __init__(self, cmd, callback): self.__cmd = cmd self.__callback = callback threading.Th