python从子线程中获得返回值
来源:互联网 发布:js array set 去重 编辑:程序博客网 时间:2024/05/16 16:17
# coding:utf-8import timefrom threading import Threaddef foo(number): time.sleep(20) return numberclass MyThread(Thread): def __init__(self, number): Thread.__init__(self) self.number = number def run(self): self.result = foo(self.number) def get_result(self): return self.resultthd1 = MyThread(3)thd2 = MyThread(5)thd1.start()thd2.start()thd1.join()thd2.join()print thd1.get_result()print thd2.get_result()
0 0
- python从子线程中获得返回值
- python获得子线程的返回值
- python获得子线程的返回值
- 从子线程返回值
- Java中获得线程的返回值
- Java中获得线程的返回值
- python获得线程调用函数的返回值
- 从system返回值中获得程序退出码
- 在子线程中获得JNIEnv|AttachCurrentThread
- 获得子进程的返回值
- 从java线程中获得运算结果
- 从java线程中获得运算结果
- 从线程中产生返回值--Callable接口
- 如何获得线程的返回值?
- Java多线程---从线程中返回数据
- Callable接口 获得线程返回值----线程相关内容
- [Web]如何实现从模式窗体-网页对话框 中获得返回值
- [Web]如何实现从模式窗体-网页对话框 中获得返回值
- spring(七)---基于mysql数据库的三种连接池的配置
- 叠筐
- Sudoku(数独缩小版(4*4))
- H.323 Plus voip
- 12222
- python从子线程中获得返回值
- Python thread 多线程
- Hibernate映射数据库关系
- Sql之left join(左关联)、right join(右关联)、inner join(自关联)的区别
- 基于SpringMVC框架使用ECharts3.0实现折线图,柱状图,饼状图,的绘制(上篇)
- docker 命令的笔记
- 微信小程序,个人开发者创业新平台
- CSS盒子模型概述
- HDU 5547 (模拟)