2011-04-01 13:25:27 -07:00
|
|
|
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()
|
2011-04-01 23:10:29 -07:00
|
|
|
|
|
|
|
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()
|