How to Install and Uninstall perl-Parallel-ForkManager Package on openSUSE Leap
Last updated: December 25,2024
1. Install "perl-Parallel-ForkManager" package
Please follow the guidance below to install perl-Parallel-ForkManager on openSUSE Leap
$
sudo zypper refresh
Copied
$
sudo zypper install
perl-Parallel-ForkManager
Copied
2. Uninstall "perl-Parallel-ForkManager" package
Please follow the instructions below to uninstall perl-Parallel-ForkManager on openSUSE Leap:
$
sudo zypper remove
perl-Parallel-ForkManager
Copied
3. Information about the perl-Parallel-ForkManager package on openSUSE Leap
Information for package perl-Parallel-ForkManager:
--------------------------------------------------
Repository : Main Repository
Name : perl-Parallel-ForkManager
Version : 2.02-bp155.1.4
Arch : noarch
Vendor : openSUSE
Installed Size : 86.6 KiB
Installed : No
Status : not installed
Source package : perl-Parallel-ForkManager-2.02-bp155.1.4.src
Upstream URL : https://metacpan.org/release/Parallel-ForkManager
Summary : Simple Parallel Processing Fork Manager
Description :
This module is intended for use in operations that can be done in parallel
where the number of processes to be forked off should be limited. Typical
use is a downloader which will be retrieving hundreds/thousands of files.
The code for a downloader would look something like this:
use LWP::Simple;
use Parallel::ForkManager;
...
my @links=(
["http://www.foo.bar/rulez.data","rulez_data.txt"],
["http://new.host/more_data.doc","more_data.doc"],
...
);
...
my $pm = Parallel::ForkManager->new(30);
LINKS:
foreach my $linkarray (@links) {
$pm->start and next LINKS; # do the fork
my ($link, $fn) = @$linkarray;
warn "Cannot get $fn from $link"
if getstore($link, $fn) != RC_OK;
$pm->finish; # do the exit in the child process
}
$pm->wait_all_children;
First you need to instantiate the ForkManager with the "new" constructor.
You must specify the maximum number of processes to be created. If you
specify 0, then NO fork will be done; this is good for debugging purposes.
Next, use $pm->start to do the fork. $pm returns 0 for the child process,
and child pid for the parent process (see also perlfunc(1p)/fork()). The
"and next" skips the internal loop in the parent process. NOTE: $pm->start
dies if the fork fails.
$pm->finish terminates the child process (assuming a fork was done in the
"start").
NOTE: You cannot use $pm->start if you are already in the child process. If
you want to manage another set of subprocesses in the child process, you
must instantiate another Parallel::ForkManager object!
--------------------------------------------------
Repository : Main Repository
Name : perl-Parallel-ForkManager
Version : 2.02-bp155.1.4
Arch : noarch
Vendor : openSUSE
Installed Size : 86.6 KiB
Installed : No
Status : not installed
Source package : perl-Parallel-ForkManager-2.02-bp155.1.4.src
Upstream URL : https://metacpan.org/release/Parallel-ForkManager
Summary : Simple Parallel Processing Fork Manager
Description :
This module is intended for use in operations that can be done in parallel
where the number of processes to be forked off should be limited. Typical
use is a downloader which will be retrieving hundreds/thousands of files.
The code for a downloader would look something like this:
use LWP::Simple;
use Parallel::ForkManager;
...
my @links=(
["http://www.foo.bar/rulez.data","rulez_data.txt"],
["http://new.host/more_data.doc","more_data.doc"],
...
);
...
my $pm = Parallel::ForkManager->new(30);
LINKS:
foreach my $linkarray (@links) {
$pm->start and next LINKS; # do the fork
my ($link, $fn) = @$linkarray;
warn "Cannot get $fn from $link"
if getstore($link, $fn) != RC_OK;
$pm->finish; # do the exit in the child process
}
$pm->wait_all_children;
First you need to instantiate the ForkManager with the "new" constructor.
You must specify the maximum number of processes to be created. If you
specify 0, then NO fork will be done; this is good for debugging purposes.
Next, use $pm->start to do the fork. $pm returns 0 for the child process,
and child pid for the parent process (see also perlfunc(1p)/fork()). The
"and next" skips the internal loop in the parent process. NOTE: $pm->start
dies if the fork fails.
$pm->finish terminates the child process (assuming a fork was done in the
"start").
NOTE: You cannot use $pm->start if you are already in the child process. If
you want to manage another set of subprocesses in the child process, you
must instantiate another Parallel::ForkManager object!