aboutsummaryrefslogtreecommitdiff
path: root/tests/keeper.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/keeper.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/keeper.lua b/tests/keeper.lua
index 9b38f02..6dbbd15 100644
--- a/tests/keeper.lua
+++ b/tests/keeper.lua
@@ -4,7 +4,7 @@
4-- Test program for Lua Lanes 4-- Test program for Lua Lanes
5-- 5--
6 6
7local lanes = require "lanes".configure{ with_timers = false, nb_keepers = 200} 7local lanes = require "lanes".configure{ with_timers = false, nb_keepers = 1, keepers_gc_threshold = 500}
8 8
9do 9do
10 print "Linda names test:" 10 print "Linda names test:"
@@ -12,7 +12,20 @@ do
12 local unnamedLinda2 = lanes.linda("") 12 local unnamedLinda2 = lanes.linda("")
13 local veeeerrrryyyylooongNamedLinda= lanes.linda( "veeeerrrryyyylooongNamedLinda", 1) 13 local veeeerrrryyyylooongNamedLinda= lanes.linda( "veeeerrrryyyylooongNamedLinda", 1)
14 print(unnamedLinda, unnamedLinda2, veeeerrrryyyylooongNamedLinda) 14 print(unnamedLinda, unnamedLinda2, veeeerrrryyyylooongNamedLinda)
15 print "GC deadlock test start"
16 -- store a linda in another linda (-> in a keeper)
17 unnamedLinda:set("here", lanes.linda("temporary linda"))
18 -- repeatedly add and remove stuff in the linda so that a GC happens during the keeper operation
19 for i = 1, 1000 do
20 for j = 1, 1000 do -- send 1000 tables
21 unnamedLinda:send("here", {"a", "table", "with", "some", "stuff"})
22 end
23 unnamedLinda:set("here") -- clear everything
24 end
15end 25end
26print "collecting garbage"
27collectgarbage()
28print "GC deadlock test done"
16 29
17local print_id = 0 30local print_id = 0
18local PRINT = function(...) 31local PRINT = function(...)