in reply to Re^16: Strange memory leak using just threads (forks.pm)
in thread Strange memory leak using just threads
No, it's not:
use strict; use warnings; use 5.010; use threads; use Chart::Clicker; use Time::HiRes qw(time); my $N = 32; my $t = time; my @thr; push @thr, threads->create( sub { 1; } ) for 1 .. $N; $_->join for (@thr); say time - $t;
Runs in 5.57 sec.
use strict; use warnings; use 5.010; use threads; use Time::HiRes qw(time); my $N = 32; my $t = time; my @thr; push @thr, threads->create( sub { require Chart::Clicker; } ) for 1 .. + $N; $_->join for (@thr); say time - $t;
Requires 34 sec to finish
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^18: Strange memory leak using just threads (forks.pm)
by BrowserUk (Patriarch) on Sep 23, 2010 at 11:54 UTC | |
by zwon (Abbot) on Sep 23, 2010 at 12:06 UTC | |
by BrowserUk (Patriarch) on Sep 23, 2010 at 15:34 UTC | |
by zwon (Abbot) on Sep 23, 2010 at 16:54 UTC | |
by BrowserUk (Patriarch) on Sep 23, 2010 at 17:23 UTC | |
|