Skip to content

got incorrect result with gevent  #52

@torpedoallen

Description

@torpedoallen
import time
import gevent.monkey
gevent.monkey.patch_all()

a = time.time()
mc.set('a', 1)

def add(key):
    #with lock:
    mc.incr(key)

jobs = []
for i in xrange(1000):
    jobs.append(gevent.spawn(add, 'a'))
gevent.joinall(jobs)
print mc.get('a')
mc.delete('a')
print time.time() - a

just like the code above, It gives 995 but 1001 as suppose to be. Is there any idea about this issue?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions