def fork_example_args(): gs.wait(100) print "fork_example_args:", gs.time(), " start" gs.fork([counter]*4, args=[("a",9),("bb",5),(),()], keyargs=[{},{},dict(name="ccc",last=7),dict(name="dddd",last=15)]) print "fork_example_args:", gs.time(), " finish"
def fork_example_args(): gs.wait(100) print "fork_example_args:", gs.time(), " start" gs.fork([counter] * 4, args=[("a", 9), ("bb", 5), (), ()], keyargs=[{}, {}, dict(name="ccc", last=7), dict(name="dddd", last=15)]) print "fork_example_args:", gs.time(), " finish"
def fork_example(): print "fork_example:", gs.time(), " start" gs.fork( [lambda: counter("a",9), lambda: counter("bb",5), lambda: counter("ccc",7), lambda: counter("dddd",15), ], wait_for = 2, kill = True, debug = False) print "fork_example:", gs.time(), " finish"
def fork_example(): print "fork_example:", gs.time(), " start" gs.fork([ lambda: counter("a", 9), lambda: counter("bb", 5), lambda: counter("ccc", 7), lambda: counter("dddd", 15), ], wait_for=2, kill=True, debug=False) print "fork_example:", gs.time(), " finish"