From: Salvador F. <sfa...@ya...> - 2012-04-17 08:16:28
|
----- Original Message ----- > From: Bryan Bueter <br...@bu...> > To: exp...@li... > Cc: > Sent: Monday, April 16, 2012 9:20 PM > Subject: [Expectperl-discuss] Yet Another Threading Example > > Ok, still playing around with threading on top of Expect, and I've > designed what I think is a pretty good solution. However there is much I > dont understand and I'm looking for feedback to make sure i'm not doing > something inherently wrong. > > The way I've been able to do this is by pre-allocating pty's for jobs > I'm > going to need, in this case i'm ssh'ing so i need one pty per host. > > After the pty's are set up, i fork off one or more worker process who > reads in a list of command from a pipe. When the worker gets a hostname > it then forks another process who ties STDIN/OUT/ERR to the pty for that > host and exec's the ssh command. Have you considered using Net::OpenSSH or Net::OpenSSH::Parallel? |