为啥吃内存吃那么厉害

def threadproc(tid):
for i in range(1000000):
print "threadid %i " %tid
sleep(0.1)

线程函数是这样的

coding=utf-8

import threading
from time import sleep

def threadproc(tid):
for i in range(1000000):
print "threadid %i " %tid
sleep(0.1)

if name == 'main':
for i in range(100):
t = threading.Thread(target=threadproc,args=(i,))
t.start()

原文地址:https://www.cnblogs.com/ITniu/p/6419737.html