From 3236320311f15640083c5bf420bcdeab725ff242 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 25 Jan 2012 02:29:35 +1000 Subject: Hack together LuaSL, LuaJIT, and luaproc. It's frankenstein right now. lol --- LuaSL/testLua/luaprocTest1_C.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 LuaSL/testLua/luaprocTest1_C.lua (limited to 'LuaSL/testLua/luaprocTest1_C.lua') 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 @@ +result, error_msg = luaproc.newproc( [=[ + + local count = 0 + +-- Hmm, luajit 2 beta 9 crashes at about 8140, lua can go up to 50000 at least. + for i = 1, 8000 do + local channel = "channel" .. i +-- local proc = 'print(luaproc.receive("channel' .. i .. '") .. " " .. ' .. i ..')' + local proc = 'luaproc.receive("' .. channel .. '")' + +-- print(channel .. "\n" .. proc) + result, error_msg = luaproc.newchannel(channel) + if not result then print(error_msg) end + result, error_msg = luaproc.newproc(proc) + if not result then print(error_msg) else count = count + 1 end + end + + print("Started " .. count .. " Lua threads") + + if 0 ~= count then + for i = 1, count do + result, error_msg = luaproc.send("channel" .. i, 'luaproc is working fine! ' .. i) + if not result then print(error_msg .. " " .. i) end + end + end +]=] ) +if not result then print(error_msg .. " for main proc") end + -- cgit v1.1