aboutsummaryrefslogtreecommitdiff
path: root/tests/keeper.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/keeper.lua')
-rw-r--r--tests/keeper.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/keeper.lua b/tests/keeper.lua
index e758b54..d08dd98 100644
--- a/tests/keeper.lua
+++ b/tests/keeper.lua
@@ -3,20 +3,20 @@
3-- 3--
4-- Test program for Lua Lanes 4-- Test program for Lua Lanes
5-- 5--
6-- TODO: there is a random crash when nb_keepers > 1. Will have to investigate 6-- TODO: there is a random crash when nb_user_keepers > 1. Will have to investigate if it rears its ugly head again
7local lanes = require "lanes".configure{ with_timers = false, nb_keepers = 1, keepers_gc_threshold = 500} 7local lanes = require "lanes".configure{ nb_user_keepers = 3, keepers_gc_threshold = 500 }
8 8
9do 9do
10 print "Linda names test:" 10 print "Linda names test:"
11 local unnamedLinda = lanes.linda() 11 local unnamedLinda = lanes.linda(1)
12 local unnamedLinda2 = lanes.linda("") 12 local unnamedLinda2 = lanes.linda("", 2)
13 local veeeerrrryyyylooongNamedLinda= lanes.linda( "veeeerrrryyyylooongNamedLinda", 1) 13 local veeeerrrryyyylooongNamedLinda= lanes.linda( "veeeerrrryyyylooongNamedLinda", 3)
14 print(unnamedLinda, unnamedLinda2, veeeerrrryyyylooongNamedLinda) 14 print(unnamedLinda, unnamedLinda2, veeeerrrryyyylooongNamedLinda)
15 print "GC deadlock test start" 15 print "GC deadlock test start"
16 -- store a linda in another linda (-> in a keeper) 16 -- store a linda in another linda (-> in a keeper)
17 unnamedLinda:set("here", lanes.linda("temporary linda")) 17 unnamedLinda:set("here", lanes.linda("temporary linda", 0))
18 -- repeatedly add and remove stuff in the linda so that a GC happens during the keeper operation 18 -- repeatedly add and remove stuff in the linda so that a GC happens during the keeper operation
19 for i = 1, 1000 do 19 for i = 1, 100 do
20 for j = 1, 1000 do -- send 1000 tables 20 for j = 1, 1000 do -- send 1000 tables
21 -- print("send #" .. j) 21 -- print("send #" .. j)
22 unnamedLinda:send("here", {"a", "table", "with", "some", "stuff"}) 22 unnamedLinda:send("here", {"a", "table", "with", "some", "stuff"})