Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Parallel::Queue 1.00

    Download button

    No screenshots available
    Downloads: 331  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steven Lembark | More programs
    Perl Artistic License / FREE
    April 18th, 2007, 23:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Parallel::Queue description

    Parallel::Queue is a Perl module to fork or thread a list of closures N-way parallel.

    Parallel::Queue is a Perl module to fork or thread a list of closures N-way parallel.

    SYNOPSIS

    # example queue:
    # only squish files larger than 8KB in size. figure
    # that the system can handle four copies of squish
    # running at the same time without them interfering
    # with one another.

    my @queue = map { -s > 8192 ? sub{ squish $_ } : () } @filz;

    # functional: pass in the count and list of coderefs.
    #
    # adding 'runqueue' exports the subroutine into
    # the current package. useful for non-OO situations.
    #
    # run the queue 4 way parallel.

    use Parallel::Queue qw( runqueue verbose fork );

    my @remaining = runqueue 4, @queue;

    die "Incomplete jobs" if @remaining;

    # OO: generate queue manager and use without the
    # 'runqueue' arguments, construct a queue manager,
    # and use it to run the jobs

    use Parallel::Queue;

    my $quemgr = Parallel::Queue->construct( thread );

    $quemgr->runqueue( 4, @queue );

    die "Incomplete jobs" if @queue;

    # call Parallel::Queue with the default configuration
    # (fork quietly).

    require Parallel::Queue;

    Parallel::Queue->runqueue( 4, @queue );

    # pre-define defaults for the objects: leave
    # out runqueue, set the rest, and construct
    # an object. the one here gets verbose, thread,
    # and debug all set to true.

    use Parallel::Queue qw( verbose thread );

    my $quemgr = Parallel::Queue->construct( debug );

    my @remaining = $quemgr->runqueue( 4, @queue );

    Given a count and an array of coderefs (most likely closures), runqueue will run the jobs in parallel. The jobs can be run via fork or detached threads [see known issues for threading]. Jobs on the queue are executed until one of them exits non-zero, the fork/thread operation fails, or all of them are dispatched (i.e., the queue is empty).

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    parallel closures | N-way parallel | Perl module | Parallel::Queue | N-way | parallel

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM