init
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import thread, time
|
||||
|
||||
def work():
|
||||
j = 0.0
|
||||
for i in xrange(10000000):
|
||||
j = j + j/2.0
|
||||
|
||||
def child(tid):
|
||||
print "%d start" % tid
|
||||
work()
|
||||
print "%d stop" % tid
|
||||
|
||||
def parent():
|
||||
i = 0
|
||||
while True:
|
||||
i += 1
|
||||
thread.start_new(child, (i,))
|
||||
if raw_input() == 'q': break
|
||||
|
||||
parent()
|
||||
Reference in New Issue
Block a user