Changeset 1125


Ignore:
Timestamp:
12/13/10 02:06:08 (3 years ago)
Author:
bruno
Message:
  • Adds parallelization support for build file generation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1124 r1125  
    503503$opt2 = $opt->{$appname} if (defined $opt); 
    504504pb_check_requirements($req2,$opt2); 
     505 
     506# 
     507# Check if we can launch some actions in // with Parallel::ForkManager 
     508# 
     509my $pbparallel = 12; 
     510eval 
     511{ 
     512    require Parallel::ForkManager; 
     513    Parallel::ForkManager->import(); 
     514}; 
     515# Parallel::ForkManager not found so no // actions 
     516if ($@) { 
     517    $pbparallel = undef; 
     518} 
    505519 
    506520pb_log(0,"Project: $ENV{'PBPROJ'}\n"); 
     
    780794            } 
    781795 
     796            # Try to use // processing here 
     797            my $pm = new Parallel::ForkManager($pbparallel) if (defined $pbparallel); 
     798 
    782799            foreach my $d (keys %virt) { 
     800                $pm->start and next if (defined $pbparallel); 
    783801                my ($name,$ver,$arch) = split(/-/,$d); 
    784802                pb_log(0,"Bad format for $d") if ((not defined $name) || (not defined $ver) || (not defined $arch)) ; 
     
    864882                    } 
    865883                } 
    866             } 
     884                $pm->finish if (defined $pbparallel); 
     885            } 
     886            $pm->wait_all_children if (defined $pbparallel); 
    867887            my @found; 
    868888            my @notfound; 
Note: See TracChangeset for help on using the changeset viewer.