aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/luaprocTest1_C.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--LuaSL/testLua/luaprocTest1_C.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/LuaSL/testLua/luaprocTest1_C.lua b/LuaSL/testLua/luaprocTest1_C.lua
new file mode 100644
index 0000000..61cb461
--- /dev/null
+++ b/LuaSL/testLua/luaprocTest1_C.lua
@@ -0,0 +1,28 @@
1result, error_msg = luaproc.newproc( [=[
2
3 local count = 0
4
5-- Hmm, luajit 2 beta 9 crashes at about 8140, lua can go up to 50000 at least.
6 for i = 1, 8000 do
7 local channel = "channel" .. i
8-- local proc = 'print(luaproc.receive("channel' .. i .. '") .. " " .. ' .. i ..')'
9 local proc = 'luaproc.receive("' .. channel .. '")'
10
11-- print(channel .. "\n" .. proc)
12 result, error_msg = luaproc.newchannel(channel)
13 if not result then print(error_msg) end
14 result, error_msg = luaproc.newproc(proc)
15 if not result then print(error_msg) else count = count + 1 end
16 end
17
18 print("Started " .. count .. " Lua threads")
19
20 if 0 ~= count then
21 for i = 1, count do
22 result, error_msg = luaproc.send("channel" .. i, 'luaproc is working fine! ' .. i)
23 if not result then print(error_msg .. " " .. i) end
24 end
25 end
26]=] )
27if not result then print(error_msg .. " for main proc") end
28