Re: Win32::Process - Limiting the number of processes launched from within a script
From: Chris (ceo_at_nospan.on.net)
Date: 01/28/04
- Next message: Mark Shelor: "Re: Using DATA with Multiple Input Files"
- Previous message: Matt: "Log File Trimming"
- In reply to: Patrick Paquet: "Win32::Process - Limiting the number of processes launched from within a script"
- Next in thread: Patrick Paquet: "Re: Win32::Process - Limiting the number of processes launched from within a script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 05:09:26 GMT
Patrick Paquet wrote:
> Hello everyone,
>
> I've been working on a script that fetches information from all
> workstations on our NT domain, the problem I've now run into at this
> point is that it takes a very long time to execute completely. The
> reason for this is probably simply because I'm checking each machine
> in sequence (I check machine A, and only when I'm done do I move on to
> B etc).
>
> I've been looking into running these checks in parallel, via the
> Win32::Process module, but I haven't found a way to control the
> number of simultaneous processes adequately. I can launch a certain
> number of them, but I can't figure out how to check the status of a
> process and to lower a counter when it's done, so that I can launch
> another one to replace it. What I'm looking to do is lauch no more
> then 10 (for example) instances of the script, and to stay as close to
> that without going over as long as there are machines to check.
> Making sense?
>
> [snipage]
> I'm running ActiveState Perl 5.005_02, and cannot upgrade it. Many
> scripts are run centrally and I don't have authority to do the upgrade
> on the script server.
>
Ewww. I tried using Perl 5.005_03 once (from Hip Communications - the
predecessor name to AS) and it was awful. I'd say as someone else said
that your options are limited with this version of Perl - very limited.
Not even David Roth can help you with that and he's king of Perl Win32...
If it were me, I might try (roughly) writing a listener that I could put
on every end point (node) that listened on say port 9010 (or some other
port). Have a central listener on a central machine on port 9011 (or
some other port) to handle replies to requests sent to the listener port
of the end nodes. Have the central box run a request out to all the (or
a batch of) listeners on port 9010 and wait for the replies to come back
in on port 9011. You can batch your requests based on the capacity of
the central listener (on port 9011) to handle replies. When the central
node receives all the replies (or gives up trying/waiting due to end
node down, etc), then you are done.
The simplest way to write a listener in Perl on Windows (with the
version you have) IMO is to combine your listener code with SRVANY.EXE
(available on Windows RK CD) and create Windows service daemons.
Chris
-----
Chris Olive
chris +at+ technologEase +dot+ com
http://www.technologEase.com
(pronounced "technlogies")
- Next message: Mark Shelor: "Re: Using DATA with Multiple Input Files"
- Previous message: Matt: "Log File Trimming"
- In reply to: Patrick Paquet: "Win32::Process - Limiting the number of processes launched from within a script"
- Next in thread: Patrick Paquet: "Re: Win32::Process - Limiting the number of processes launched from within a script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|