468,288 Members | 1,992 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,288 developers. It's quick & easy.

[help]problem with python thread

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
0 1181

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Stangonline.com | last post: by
1 post views Thread by wccppp | last post: by
5 posts views Thread by pekka niiranen | last post: by
4 posts views Thread by PGMoscatt | last post: by
5 posts views Thread by japslam japslam via DotNetMonster.com | last post: by
2 posts views Thread by funkky | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.