By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,097 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,097 IT Pros & Developers. It's quick & easy.

[help]problem with python thread

P: n/a
Hi,all:
Could someone explan the python thread to me?
When I use the python thread,I find some problems.If I run many
(such as 100) python threads ,then all thread are blocked.Below is the code:
import thread,time
def f():
print 'f()'

def loop():
while True:
f()

for i in xrange(100):
t=threading.Thread(target=loop)
t.start()

time.sleep(100000000)

I run this program on red hat linux.The intersting thing is that
the program sometimes works,but somtimes blocks(no output at all).

Oct 29 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.