摘要: 原文地址:http://www.cnblogs.com/fengmk2/archive/2008/06/04/1213958.html 在threading module中,有一个非常特别的类local。一旦在主线程实例化了一个local,它会一直活在主线程中,并且又主线程启动的子线程调用这个local实例时,它的值将会保存在相应的子线程的字典中。 我们先看看测试代码:#!/usr/bin/python# -*- coding: utf-8 -*-# Description: test the threading.local class# Create: 2008-6-4# Author: M 阅读全文
posted @ 2011-03-09 22:42 Donal 阅读(718) 评论(0) 推荐(0) 编辑