阅读背景:

数据库链接池之threading.local线程版

来源:互联网 

线程标识ident

import threading
from threading import get_ident

def task():
    ident = get_ident()
    print(ident)
for i in range(20):
    t = threading.Thread(target=task)
    t.start()import threading
from threading impo



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: