v13.0.0 #11
@ -1003,7 +1003,7 @@ multi:SystemThreadedBenchmark(1).OnBench(function(...)
|
||||
end)
|
||||
multi:mainloop()
|
||||
```
|
||||
ST - SystemThreadedExecute
|
||||
ST - SystemThreadedExecute WIP* Might remove
|
||||
--------------------------
|
||||
|
||||
Network Threads - Multi-Integration
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#Changes
|
||||
[TOC]
|
||||
Update 13.0.0 So you documented it, finally! New additions/changes/ and fixes
|
||||
Update 13.0.0 So you documented it, finally! If I had a dollar for each time I found a bug working on 13.0.0 I'd be quite wealthy by now. How much lag could one expect when I've been coding with my own library wrong this entire time?
|
||||
-------------
|
||||
Fixed: Tons of bugs, I actually went through the entire library and did a full test of everything, I mean everything, while writing the documentation.
|
||||
Changed:
|
||||
@ -48,6 +48,9 @@ Fixed:
|
||||
- There were some bugs in the networkmanager.lua file. Desrtoy -> Destroy some misspellings.
|
||||
- Massive object management bugs which caused performance to drop like a rock. Remember to Destroy objects when no longer using them. I should probably start working on a garbage collector for these objects!
|
||||
- Found a bug with processors not having the Destroy() function implemented properly.
|
||||
- Found an issue with the rockspec which is due to the networkManager additon. The net Library and the multi Library are now codependent if using that feature. Going forward you will have to now install the network library separately
|
||||
- Insane proformance bug found in the networkManager file, where each connection to a node created a new thread (VERY BAD) If say you connected to 100s of threads, you would lose a lot of processing power due to a bad implementation of this feature. But it goes futhur than this, the net library also creates a new thread for each connection made, so times that initial 100 by about 3, you end up with a system that quickly eats itself. I have to do tons of rewriting of everything. Yet another setback for the 13.0.0 release
|
||||
- Fixed an issue where any argument greater than 256^2/65536 bytes is sent the networkmanager would soft crash. This was fixed by increading the limit to 256^4/4294967296 bytes. The fix was changing a 2 to a 4. Arguments greater than 256^4 would be impossible in 32 bit lua, and highly unlikely even in lua 64 bit. Perhaps someone is reading an entire file into ram and then sending the entire file that they read over a socket for some reason all at once!?
|
||||
|
||||
Added:
|
||||
- multi:newHyperThreadedProcess(STRING name) -- This is a version of the threaded process that gives each object created its own coroutine based thread which means you can use thread.* without affecting other objects created within the hyper threaded processes.
|
||||
|
||||
@ -1808,6 +1808,7 @@ function multi:mainloop(settings)
|
||||
local solid
|
||||
local sRef
|
||||
while mainloopActive do
|
||||
--print(mainloopActive)
|
||||
if ncount ~= 0 then
|
||||
for i = 1, ncount do
|
||||
next[i]()
|
||||
|
||||
@ -287,7 +287,7 @@ function multi:newNode(settings)
|
||||
local temp = bin.new(dat)
|
||||
local len = temp:getBlock("n",1)
|
||||
local name = temp:getBlock("s",len)
|
||||
len = temp:getBlock("n",2)
|
||||
len = temp:getBlock("n",4)
|
||||
local args = temp:getBlock("s",len)
|
||||
_G[name](unpack(resolveData(args)))
|
||||
elseif cmd == CMD_TASK then
|
||||
@ -356,7 +356,7 @@ function multi:newMaster(settings) -- You will be able to have more than one mas
|
||||
if settings.managerDetails then
|
||||
local client = net:newTCPClient(settings.managerDetails[1],settings.managerDetails[2])
|
||||
if not client then
|
||||
print("Cannot connect to the node manager! Ensuring broadcast listening is enabled!") settings.noBroadCast = false
|
||||
print("Warning: Cannot connect to the node manager! Ensuring broadcast listening is enabled!") settings.noBroadCast = false
|
||||
else
|
||||
client.OnDataRecieved(function(client,data)
|
||||
local cmd = data:sub(1,1)
|
||||
@ -406,7 +406,7 @@ function multi:newMaster(settings) -- You will be able to have more than one mas
|
||||
temp:addBlock(CMD_CALL,1)
|
||||
temp:addBlock(#name,1)
|
||||
temp:addBlock(name,#name)
|
||||
temp:addBlock(#args,2)
|
||||
temp:addBlock(#args,4)
|
||||
temp:addBlock(args,#args)
|
||||
master:sendTo(node,temp.data)
|
||||
end
|
||||
|
||||
31
rockspecs/multi-13.0-0.rockspec
Normal file
31
rockspecs/multi-13.0-0.rockspec
Normal file
@ -0,0 +1,31 @@
|
||||
package = "multi"
|
||||
version = "13.0-0"
|
||||
source = {
|
||||
url = "git://github.com/rayaman/multi.git",
|
||||
tag = "v13.0.0",
|
||||
}
|
||||
description = {
|
||||
summary = "Lua Multi tasking library",
|
||||
detailed = [[
|
||||
This library contains many methods for multi tasking. From simple side by side code using multi-objs, to using coroutine based Threads and System threads(When you have lua lanes installed or are using love2d)
|
||||
]],
|
||||
homepage = "https://github.com/rayaman/multi",
|
||||
license = "MIT"
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1",
|
||||
"bin",
|
||||
"lanes",
|
||||
}
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = {
|
||||
["multi.init"] = "multi/init.lua",
|
||||
["multi.compat.love2d"] = "multi/compat/love2d.lua",
|
||||
["multi.integration.lanesManager"] = "multi/integration/lanesManager.lua",
|
||||
["multi.integration.loveManager"] = "multi/integration/loveManager.lua",
|
||||
["multi.integration.luvitManager"] = "multi/integration/luvitManager.lua",
|
||||
["multi.integration.networkManager"] = "multi/integration/networkManager.lua",
|
||||
["multi.integration.shared"] = "multi/integration/shared.lua"
|
||||
}
|
||||
}
|
||||
16
test.lua
16
test.lua
@ -14,18 +14,22 @@ end
|
||||
master = multi:newMaster{
|
||||
name = "Main", -- the name of the master
|
||||
--noBroadCast = true, -- if using the node manager, set this to true to avoid double connections
|
||||
managerDetails = {"192.168.1.4",12345}, -- the details to connect to the node manager (ip,port)
|
||||
--~ managerDetails = {"192.168.1.4",12345}, -- the details to connect to the node manager (ip,port)
|
||||
}
|
||||
master.OnError(function(name,err)
|
||||
print(name.." has encountered an error: "..err)
|
||||
end)
|
||||
master.OnNodeConnected(function(name)
|
||||
multi:newThread("Main Thread Data Sender",function()
|
||||
local connlist = {}
|
||||
multi:newThread("NodeUpdater",function()
|
||||
while true do
|
||||
thread.sleep(.5)
|
||||
conn = master:execute("TASK_MAN",name, multi:getTasksDetails())
|
||||
thread.sleep(1)
|
||||
for i=1,#connlist do
|
||||
conn = master:execute("TASK_MAN",connlist[i], multi:getTasksDetails())
|
||||
end
|
||||
end,5)
|
||||
end
|
||||
end)
|
||||
master.OnNodeConnected(function(name)
|
||||
table.insert(connlist,name)
|
||||
end)
|
||||
multi.OnError(function(...)
|
||||
print(...)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user