develooper Front page | perl.ithreads | Postings from April 2008

RE: Work Crew example

Thread Previous
From:
Chris Fowler
Date:
April 24, 2008 17:32
Subject:
RE: Work Crew example
Message ID:
1209083574.21630.234.camel@shuttle

On Thu, 2008-04-24 at 17:21 -0700, Wong, Danny H. wrote:
> Thanks. I'll take a look at it and give it a go...  
> 
Bug

>       print "$target:DOWN\n"; 
print W "$target:DOWN\n";
>     } else {
>       print "$target:UP\n";
print W "$target:UP\n";

Even with those changes the pipes don't work so well.



GUIs are a better example of threads.  In a GUI you need threads to do
work and then update an area.

Have you ever written a Java Swing application that had not threads?
You could clock on the button for it to do something and the whole
display seemed to freeze.  If you iconized it and then restored it, it
would just be a square on the screen.  The program was too busy working
on that one request.  In a GUI you should spawn a thread and have it
update the GUI components.  It may be blocking in connect() in the
background but your application still looks responsive.



Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About