use strict; use threads; use warnings; use Win32::GUI qw(); use LWP::UserAgent; my $window = Win32::GUI::DialogBox->new( -title => "Test", -name => "T +est", -onTimer => sub { return poll() } ); my $use_up_some_memory = join( "", "x" x (1024 * 1024 * 20) ); $window->AddTimer( "T1", 20000 ); $window->Show; Win32::GUI::Dialog(); sub poll { my $rss : shared; print "polling\n"; my $thread = threads->create( sub { my $ua = LWP::UserAgent->new; my $response = $ua->get( 'http://www.mektek.net/mekmatch/listS +erversRss.mkz' ); $rss = $response->decoded_content if $response->is_success; } ); while ( $thread->is_running ) { sleep(1); Win32::GUI::DoEvents; } return unless $rss; }
In reply to Re^2: threads causing memory leak
by holli
in thread threads causing memory leak
by holli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |