threading.Thread vs. signal.signal

2005-09-17 Thread Jack Orenstein
t fraction of a second to execute.) Jack Orenstein import sys import signal import threading import datetime import time class metronome(threading.Thread): def __init__(self, interval, function): threading.Thread.__init__(self) self.interval = interval self.func

Threading and consuming output from processes

2005-02-24 Thread Jack Orenstein
aiting threads; or I find some other problem that makes me wonder about the stability of the threading module. I can post details on the problems I'm seeing, but I thought it would be good to get general feedback first. (Googling doesn't turn up any signs of trouble.) Thanks. Jack Orenstei

Re: Threading and consuming output from processes

2005-02-26 Thread Jack Orenstein
I asked: I am developing a Python program that submits a command to each node of a cluster and consumes the stdout and stderr from each. I want all the processes to run in parallel, so I start a thread for each node. There could be a lot of output from a node, so I have a thread reading each stream

Thread scheduling

2005-02-26 Thread Jack Orenstein
ine 26, in ? time.sleep(1) KeyboardInterrupt [EMAIL PROTECTED] osh]$ In this case, thread 1 finishes but thread 2 never runs again. Is this a known problem? Any ideas for workarounds? Are threads widely used in Python? Jack Orenstein # threadtest.py import sys import thread import time nThr

Re: Thread scheduling

2005-02-26 Thread Jack Orenstein
Peter Hansen wrote: > Jack Orenstein wrote: > >> I am using Python 2.2.2 on RH9, and just starting to work with Python >> threads. > > > Is this also the first time you've worked with threads in general, > or do you have much experience with them in other situ

Re: Thread scheduling

2005-02-26 Thread Jack Orenstein
On my machines (one Py2.4 on WinXP, one Py2.3.4 on RH9.0) I don't see this behaviour. Across about fifty runs each. Thanks for trying this. One thing you might try is experimenting with sys.setcheckinterval(), just to see what effect it might have, if any. That does seem to have an impact. At 0, t

distutils setup ignoring scripts

2005-03-14 Thread Jack Orenstein
'Foo Bar', author = 'Jack Orenstein', author_email = '[EMAIL PROTECTED]', packages = ['', 'xyz'], scripts = ['bin/foobar'] ) The resulting package has everything in the specified directories, but

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread Jack Orenstein
ists are ordered in the same way, then you could walk through the lists in order using a merge procedure, generating a new list as you go. After ruling out slow data structures and algorithms, you'll almost certainly be better off using something built in to Python rather than c