Skip to content

Instantly share code, notes, and snippets.

View raphaelsoul's full-sized avatar
㊗️
Question: why it works? why it not works? why it works after I restart?

Dechen Zhuang raphaelsoul

㊗️
Question: why it works? why it not works? why it works after I restart?
  • China
View GitHub Profile
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import queue as Queue
import threading
import time
exitFlag = 0
class myThread (threading.Thread):
@raphaelsoul
raphaelsoul / another sample
Last active March 28, 2016 09:18
对比测试多线程性能
from threading import Thread
import queue
import time
# q是任务队列
#NUM是并发线程总数
#JOBS是有多少任务
q = queue.Queue()
NUM = 2
JOBS = 10
#具体的处理函数,负责处理单个任务
@raphaelsoul
raphaelsoul / header.py
Created March 18, 2016 06:09
standard and recomanded python head
#! /usr/bin/env python
# -*- coding: utf-8 -*-