def main(): mm = ObjectMmap(-1, 1024 * 1024, access=test_mmap.ACCESS_READ, tagname='share_mmap') while True: print('*' * 30) print(mm.jsonread_follower())
def main(): mm = ObjectMmap(-1, 1024 * 1024, access=test_mmap.ACCESS_WRITE, tagname='share_mmap') while True: length = random.randint(1, 100) p = range(length) mm.jsonwrite(p) print('*' * 30) print(mm.jsonread_master())
def main(): mm = ObjectMmap(-1, 1024*1024, access=mmap.ACCESS_WRITE, tagname='share_mmap') count = 0 while True: length = random.randint(1, 10) p = range(length) mm.jsonwrite(p) print '*' * 15 + str(count) + '*' * 15 print mm.jsonread_follower() count += 1 time.sleep(random.randint(1, 10))
def main(): mm = ObjectMmap(-1, 1024*1024, access=mmap.ACCESS_WRITE, tagname='share_mmap') count = 0 while True: obj = mm.jsonread_follower() if obj: print '*' * 15 + str(count) + '*' * 15 print obj count += 1 else: pass time.sleep(1)
def main(): mm = ObjectMmap(-1, 1024 * 1024, access=mmap.ACCESS_WRITE, tagname='share_mmap') count = 0 while True: obj = mm.jsonread_follower() if obj: print '*' * 15 + str(count) + '*' * 15 print obj count += 1 else: pass time.sleep(1)
def main(): mm = ObjectMmap(-1, 1024 * 1024, access=mmap.ACCESS_WRITE, tagname='share_mmap') while True: #length = random.randint(1, 100) #p = range(length) p = {'time':time.time()} mm.jsonwrite(p) print '*' * 30 print mm.jsonread_master() time.sleep(3)
def main(): mm = ObjectMmap(-1, 1024 * 1024, access=mmap.ACCESS_WRITE, tagname='share_mmap') count = 0 while True: length = random.randint(1, 10) p = range(length) mm.jsonwrite(p) print '*' * 15 + str(count) + '*' * 15 print mm.jsonread_follower() count += 1 time.sleep(random.randint(1, 10))
def main(): mm = ObjectMmap(-1, 1024 * 1024, access=test_mmap.ACCESS_READ, tagname="share_mmap") while True: print("*" * 30) print(mm.jsonread_follower())