Esempio n. 1
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)
Esempio n. 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())
Esempio n. 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))
Esempio n. 4
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))