From: keithv on
I'm writing a program that converts a
source file into a different format via
an external program. I'm doing this with
a call to exec, and that all works fine.
However, since I need to convert thousands of
files and each one takes tens of seconds,
I'd thought I'd try to improve
performance by using four or five simultaneous
command pipelines (open |cmd...) and using file
events to grab the results.

But now I'm running into a weird problem:
more often than not, the GUI freezes and
becomes unresponsive. I can't scroll or
press buttons until one of the pipelines
finishes and before the next one starts.

Does anybody know whats going on? I'm not
doing much in the event handler except
stuffing about 300 bytes of text into a
variable.

Thanks,
Keith
From: PaulWalton on
On May 14, 12:26 pm, keithv <kvet...(a)gmail.com> wrote:
> I'm writing a program that converts a
> source file into a different format via
> an external program. I'm doing this with
> a call to exec, and that all works fine.
> However, since I need to convert thousands of
> files and each one takes tens of seconds,
> I'd thought I'd try to improve
> performance by using four or five simultaneous
> command pipelines (open |cmd...) and using file
> events to grab the results.
>
> But now I'm running into a weird problem:
> more often than not, the GUI freezes and
> becomes unresponsive. I can't scroll or
> press buttons until one of the pipelines
> finishes and before the next one starts.
>
> Does anybody know whats going on? I'm not
> doing much in the event handler except
> stuffing about 300 bytes of text into a
> variable.
>
> Thanks,
> Keith

Can you post the code? Do you have a "&" appended to the end of your
exec command?
From: RazorFish on
I've found that the liberal use of "update" can help a lot with this
problem.

http://www.tcl.tk/man/tcl8.5/TclCmd/update.htm


From: Uwe Klein on
RazorFish wrote:
> I've found that the liberal use of "update" can help a lot with this
> problem.
>
> http://www.tcl.tk/man/tcl8.5/TclCmd/update.htm
>
>
And the counterpoint:
Update considered harmful

http://wiki.tcl.tk/1255

uwe
From: Rob on
Uwe Klein wrote:

> RazorFish wrote:
>> I've found that the liberal use of "update" can help a lot with this
>> problem.
>>
>> http://www.tcl.tk/man/tcl8.5/TclCmd/update.htm
>>
>>
> And the counterpoint:
> Update considered harmful

I agree that one has to be careful using 'update'; certainly a liberal use
of 'update' could lead to significant problems.

I'd rather suggest *very* careful placement of 'update' statements will
usually help resolve most 'stuck' GUI issues. Only a very small number of
usages should suffice.

Rob.