in reply to Re^3: How to split file for threading?
in thread How to split file for threading?
I couldn't really google two forward slashes so I don't know what this means.our $T //= 4;
Ok map will transform arrays, but here it seems like it is assigning 3 threads to @threads? threads->new() creates new thread while passing the worker sub and 4 variables? or is it creating a worker sub and passing those variables to worker?my @threads = map{ threads->new( \&worker, $filename, $target, $chunks[ $_ ], $chunks +[ $_+1 ] ) } 0 .. $T-1;
this concatenates the thread results? but i don't see where or when the lines with $target were passed back and stored? Thanks againmy $total = 0; $total += $_->join for @threads;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: How to split file for threading?
by BrowserUk (Patriarch) on Jun 23, 2015 at 19:14 UTC | |
by Anonymous Monk on Jun 23, 2015 at 19:16 UTC | |
by BrowserUk (Patriarch) on Jun 23, 2015 at 19:32 UTC |