13.5.   " "   CORBA- 489

" "    PVM-.      
     " ".  " "  
  ""   ,   ""
   ,   .  -
 MPMD (MIMD),    SPMD (SIMD),   -
  posix_spawn().   13.9  ,   -
   -    ?or_each ().

//  13.9.   child_process 
//               -   
//               

class child_process(

string Command;

posix_spawnattr_t M;

posix_spawn_?ile_actions_t N;

pid_t Pid;

//. ..
public:

child_process(void) ;

void operator()(string X) ;

void spawn(string X) ;

};

void child_process::operator()(string X)
{

//. . .

posix_spawnattr_init(&M) ;

posix_spawn_?ile_actions_init(&N) ;

Command.append("/tmp/") ;

Command.append(X) ;

char *const argv[] = (const_cast<char*>(Command.data())
,NULL} ;

posix_spawn(&Pid,Command.data(),&N,&M,argv.NULL) ;

Command.erase(Command.begin(),Command.end()) ;

//. . .
}

  ,    posix_spawn(),  
child__process.   ,     
 ,         -
 ,     .    ,   
child_process    operator () (.  13.9).  ,
  child_process      
   ?or_each ().     " " , -
       ,  
    Solve.     " -
"        for_each ().

// .

//...

child_process Task;

?or_each(Solve.begin(),Solve.end(),Task) ;

        Solve -
  operator (),      13.9.  