From bba4ecea15320dfbf8edf35f7361de374d895ace Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Wed, 26 Sep 2012 21:22:30 +0200 Subject: version 3.4.0 * new method linda:dump() that outputs the full contents of a linda as a table, also linked to __towatch for Decoda support * linda:receive() API change! * instead of [val, key], linda:receive( timeout, key) returns [key, val] * instead of [val, [...]], linda:receive( timeout, linda.batched key) returns [key, val[, ...]] this is to unify the return values of regular and batched mode, and to be able to tell when batched mode is interrupted by a lane cancellation * fixed Lua 5.2 build to take into account the "loaders"->"searchers" name change in 'package' module. * a bit of html cleanup and added some infos in the documentation regarding the Lanes internals --- tests/parallel_os_calls.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/parallel_os_calls.lua (limited to 'tests/parallel_os_calls.lua') diff --git a/tests/parallel_os_calls.lua b/tests/parallel_os_calls.lua new file mode 100644 index 0000000..b8cffa1 --- /dev/null +++ b/tests/parallel_os_calls.lua @@ -0,0 +1,14 @@ +local lanes = require "lanes".configure(1) +print( os.date()) +local linda = lanes.linda() +lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() +lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() +lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() +lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() + +--[[ +lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() +lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() +lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() +lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() +]] -- cgit v1.2.3-55-g6feb