执行shell命令
|
通过“threading”创建一个线程
|
性能问题 - GIL
|
生产者和消费者
|
线程池模板
|
使用多处理ThreadPool
与“map” 性能比较
输出:
|
互斥锁
|
Deadlock
|
实现“监控”
Using RLock
output:
|
控制primitive资源
使用信号量
输出:
|
Ensure tasks has done
Using ‘event’
output: python event.py
1 wait event
2 wait event
3 wait event
2 get event set
3 get event set
1 get event set
|
线程安全优先队列
Using ‘condition’
output:
|
Multiprocessing
Solving GIL problem via processes
|
自定义多处理映射
|
优雅的方法来杀死所有的子进程
|
简单的循环调度程序
|
具有阻塞功能的调度器
output: (bash 1)
output: (bash 2)
|
PoolExecutor
|
What “with ThreadPoolExecutor” doing?
output:
|
Future Object
output:
|
Future error handling
output:
|