Re: Parallel ping problems python puzzler

2007-04-02 Thread Matimus
I wouldn't use threads for system calls. Checkout the subprocess module instead. You can run multiple pipes at the same time (subprocess.Popen). The python documentation for subprocess is pretty good. There are a few examples. Actually, you don't even _need_ the subprocess module, you can use os.po

Re: Parallel ping problems python puzzler

2007-04-02 Thread amaccormack
On 2 Apr, 15:03, "Miki" <[EMAIL PROTECTED]> wrote: > Hello, > > >def run(self): > > # -w 1 option topingmakes ittimeoutafter 1 second > > pingcmd="/bin/ping-c 2 -q -i 0.3 -w 1 %s >/dev/null" % ip > > Not sure, but "ip" should be "self.ip", this might cause theproblem. Sorry, that w

Re: Parallel ping problems python puzzler

2007-04-02 Thread Miki
Hello, >def run(self): > # -w 1 option to ping makes it timeout after 1 second > pingcmd="/bin/ping -c 2 -q -i 0.3 -w 1 %s >/dev/null" % ip Not sure, but "ip" should be "self.ip", this might cause the problem. HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- h

Parallel ping problems python puzzler

2007-04-02 Thread amaccormack
I wrote a quick script to check the "up-ness" of a list of machines, and timeout after 1 second. However, with a lot of timeouts, the script takes a logn time, so I thought to parallelise it. However, as soon as I do, the pings that do not get a response never return, so their threads block forever