Parallel::SubFork

Manage Perl functions in forked processes.
Download

Parallel::SubFork Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Emmanuel Rodriguez
  • Publisher web site:
  • http://debian.potyl.com/

Parallel::SubFork Tags


Parallel::SubFork Description

Manage Perl functions in forked processes. Parallel::SubFork is a Perl module to manage Perl functions in forked processes.SYNOPSIS use Parallel::SubFork; my $manager = Parallel::SubFork->new(); # Start two parallel tasks $manager->start(sub { sleep 10; print "Done " }); $manager->start(&callback, @args); # Wait for all tasks to resume $manager->wait_for_all(); # Loop through all tasks foreach my $task ($manager->tasks) { # Access any of the properties printf "Task with PID %d resumed ", $task->pid; printf "Exist status: %d, exit code: %d\n", $task->status, $task->exit_code; printf "Args of task where: %s ", join(', ', $task->args); print " "; }or more easily: use Parallel::SubFork qw(sub_fork); my $task = sub_fork(&callback, @args); $task->wait_for();This module provides a simple wrapper over the module Parallel::SubFork::Task which in turns simplifies the usage of the system calls fork and waitpid. The idea is to isolate the tasks to be execute in functions or closures and to execute them in a separated process in order to take advantage of parallelization. Requirements: · Perl


Parallel::SubFork Related Software