예제 #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())