一.RabbitMQ队列 安装python rabbitMQ module pip install pika or easy_install pika or 源码 https://pypi.python.org/pypi/pika 实现最简单的队列通信 模式一:一对一 说明:在这种模式下,例如你同一个管道同一个队列中,依次启动N个客户端recv,最后启动send发送消息.第一启动的recv先接收到第一条信息,send再发一个信息,这时候会被第二个启动recv收到,依次类推,这样接收到最后一个re
import java.util.ArrayList; import java.util.List; /** * Created by ccc on 16-4-27. */ public class Test { public static void main(String[] args) { GunClip clip = new GunClip(); Producer p = new Producer(clip); customer c = new customer(clip); p.star
一.多线程 1.顺序执行单个线程,注意要顺序执行的话,需要用join. #coding=utf-8 from threading import Thread import time def my_counter(): i = 0 for _ in range(100000000): i = i + 1 return True def main(): thread_array = {} start_time = time.time() for tid in range(2): t = Thread