示例#1
0
def main():
    mm = ObjectMmap(-1,
                    1024 * 1024,
                    access=test_mmap.ACCESS_READ,
                    tagname='share_mmap')
    while True:
        print('*' * 30)
        print(mm.jsonread_follower())
示例#2
0
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())
示例#3
0
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))
示例#4
0
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)
示例#5
0
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)
示例#6
0
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)
示例#7
0
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))
示例#8
0
def main():
    mm = ObjectMmap(-1, 1024 * 1024, access=test_mmap.ACCESS_READ, tagname="share_mmap")
    while True:
        print("*" * 30)
        print(mm.jsonread_follower())