会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
_simpleSmile
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
11
下一页
2019年8月6日
【10.9】multiprocessing多进程编程
摘要: imap imap_unordered
阅读全文
posted @ 2019-08-06 16:19 _simpleSmile
阅读(184)
评论(0)
推荐(0)
2019年8月5日
【10.8】多线程和多进程的比较
摘要: 对于耗费cpu的操作,例如计算。多进程优于多线程 对于io操作,多线程优于多进程
阅读全文
posted @ 2019-08-05 20:08 _simpleSmile
阅读(436)
评论(0)
推荐(0)
【10.7】ThreadPoolExecutor线程池
摘要: as_completed map wait
阅读全文
posted @ 2019-08-05 19:37 _simpleSmile
阅读(199)
评论(0)
推荐(0)
2019年8月4日
【10.6】线程同步--Semaphore 使用以及源码分析
摘要: 每2秒弹出一组3个的 ‘got html text success’ Semaphore底层是用Condition实现的
阅读全文
posted @ 2019-08-04 16:50 _simpleSmile
阅读(217)
评论(0)
推荐(0)
【10.5】线程同步--conditon 使用以及源码分析
摘要: 1 #!/user/bin/env python 2 # -*- coding:utf-8 -*- 3 4 # 条件变量,用于复杂的线程间同步 5 # 通过condition完成协同读诗 6 from threading import Lock 7 from threading import Condition 8 import threading 9 10 11 cla...
阅读全文
posted @ 2019-08-04 16:30 _simpleSmile
阅读(411)
评论(0)
推荐(0)
【10.4】线程同步--Lock、RLock
摘要: 1.用锁会影响性能 2.锁会引起死锁 RLock
阅读全文
posted @ 2019-08-04 14:58 _simpleSmile
阅读(183)
评论(0)
推荐(0)
2019年8月3日
【10.3】线程间通信--共享变量和Queue
摘要: 1.线程通信方式--共享变量 缺点,共享变量需要加锁,来达到我们想要的效果 ps:不要去尝试去运行,我设置了while循环,而且没有设置守护线程。。。 2.通过queue的方式进行线程间的通信
阅读全文
posted @ 2019-08-03 14:45 _simpleSmile
阅读(378)
评论(0)
推荐(0)
【10.2】多线程编程-threading
摘要: 1.通过Thread类实例化 2.通过继承Thread来实现多线程
阅读全文
posted @ 2019-08-03 14:01 _simpleSmile
阅读(180)
评论(0)
推荐(0)
【10.1】python中的GIL
摘要: 1 #!/user/bin/env python 2 # -*- coding:utf-8 -*- 3 4 # gil global interpreter lock(cpython)全局解释器锁 5 # python中一个线程对应于c语言中的一个线程 6 # gil时的同一时刻只有一个线程在一个cpu上执行字节码,无法将多个线程映射到多个cpu上执行 7 # gil会根据执行的...
阅读全文
posted @ 2019-08-03 13:09 _simpleSmile
阅读(187)
评论(0)
推荐(0)
2019年8月1日
【9.4】socket模拟http请求
摘要: 1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 4 # requests -> urllib -> socket 5 import socket 6 from urllib.parse import urlparse 7 8 9 def get_url(url): 10 # 通过socket请求html 11 ...
阅读全文
posted @ 2019-08-01 17:20 _simpleSmile
阅读(336)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
11
下一页
公告