aboutsummaryrefslogtreecommitdiff
path: root/tests/parallel_os_calls.lua
diff options
context:
space:
mode:
authorBenoit Germain <bnt period germain arrobase gmail period com>2017-06-05 11:25:31 +0200
committerBenoit Germain <bnt period germain arrobase gmail period com>2017-06-05 11:25:31 +0200
commitc2ca1fce531e29f8209660b18ef0a493722813f1 (patch)
tree3afa59fb910b2aaee79cbccc9a58fc961b3b8868 /tests/parallel_os_calls.lua
parent0ede50e2da00f2915ceb50184425c42bda83adfd (diff)
downloadlanes-c2ca1fce531e29f8209660b18ef0a493722813f1.tar.gz
lanes-c2ca1fce531e29f8209660b18ef0a493722813f1.tar.bz2
lanes-c2ca1fce531e29f8209660b18ef0a493722813f1.zip
Table transfer improvements
* new API function lanes.register( "name", module) to manually register a module table after it was required * Transfering registered module tables will link the equivalent in the destination state instead of cloning it * bumped version to 3.11
Diffstat (limited to 'tests/parallel_os_calls.lua')
-rw-r--r--tests/parallel_os_calls.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/parallel_os_calls.lua b/tests/parallel_os_calls.lua
index b8cffa1..7119272 100644
--- a/tests/parallel_os_calls.lua
+++ b/tests/parallel_os_calls.lua
@@ -1,11 +1,12 @@
1local lanes = require "lanes".configure(1) 1local lanes = require "lanes".configure{with_timers = false, nb_keepers = 1}
2print( os.date()) 2print( os.date())
3local linda = lanes.linda() 3local linda = lanes.linda()
4lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() 4local l1 = lanes.gen("os,base", function() print "start sleeping" linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)()
5lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() 5lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)()
6lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() 6lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)()
7lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() 7lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)()
8 8-- wait, else all lanes will get hard-cancelled at stat shutdown
9l1:join()
9--[[ 10--[[
10lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() 11lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)()
11lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() 12lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)()