This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import os, sys, time | |
from multiprocessing import Pool, Queue, Manager | |
def out(queue): | |
while True: | |
item = queue.get() | |
print item | |
time.sleep(0.01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import os, sys, time | |
from multiprocessing import Pool, Queue, Manager | |
class Data(object): | |
def __init__(self): | |
self.pool = Pool(2) | |
self.queue = Manager().Queue() |