aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/luaprocTest2_C.lua
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/testLua/luaprocTest2_C.lua')
-rw-r--r--LuaSL/testLua/luaprocTest2_C.lua65
1 files changed, 0 insertions, 65 deletions
diff --git a/LuaSL/testLua/luaprocTest2_C.lua b/LuaSL/testLua/luaprocTest2_C.lua
deleted file mode 100644
index e1a5a83..0000000
--- a/LuaSL/testLua/luaprocTest2_C.lua
+++ /dev/null
@@ -1,65 +0,0 @@
1count = 0
2
3proc = [=[
4 require "string"
5 local channel = "channel%d"
6 local message
7
8 result, error_msg = luaproc.newchannel(channel)
9 if not result then print(error_msg) end
10 repeat
11 message = luaproc.receive(channel)
12 local x, y = string.find(message, "@")
13 if not x then
14 x, y = string.find(message, "@")
15 x, y = string.find(message, "@")
16 x, y = string.find(message, "@")
17 x, y = string.find(message, "@")
18 x, y = string.find(message, "@")
19 x, y = string.find(message, "@")
20 x, y = string.find(message, "@")
21 x, y = string.find(message, "@")
22 end
23 until "quit" == message
24]=]
25
26mainProc = [=[
27 local count = %d
28 local messages = 0
29 local length = 0
30 local message = "This is a test message. 56789 12"
31
32 if 0 ~= count then
33 for k = 0, 16 do
34 for j = 0, 199 do
35 for i = 1, count do
36 result, error_msg = luaproc.send("channel" .. i, message)
37 if not result then print(error_msg .. " " .. i) else
38 messages = messages + 1
39 length = length + #message
40 end
41 end
42 end
43 message = message .. message
44 end
45
46 for i = 1, count do
47 result, error_msg = luaproc.send("channel" .. i, "quit")
48 if not result then print(error_msg .. " " .. i) end
49 end
50 end
51
52 print("Sent " .. messages .. " messages totalling " .. length .. " bytes. The largest message was " .. #message .. " bytes.")
53]=]
54
55for i = 1, 10 do
56 result, error_msg = luaproc.newproc(string.format(proc, i))
57 if not result then print(error_msg) else count = count + 1 end
58end
59
60print("Started " .. count .. " Lua threads.")
61
62result, error_msg = luaproc.newproc(string.format(mainProc, count))
63if not result then print(error_msg) end
64
65