smbinterp/bin/interactq.py

22 lines
479 B
Python

import interp.bootstrap
from multiprocessing.managers import BaseManager
class QueueManager(BaseManager): pass
QueueManager.register('get_inqueue' )
QueueManager.register('get_outqueue')
m = QueueManager(address=('localhost', 6666), authkey='asdf')
m.connect()
m.get_outqueue()
oq = m.get_outqueue()
iq = m.get_inqueue()
import time
import numpy as np
s = time.time()
for i in xrange(int(1e6)):
a = i
X = np.random.random((1,3))[0]
iq.put((i,5,128,X))
e = time.time()