added priorityManager to rockspec

This commit is contained in:
Ryan Ward 2024-02-24 23:57:42 -05:00
parent ffaab32d5e
commit 7b0cb7a853
4 changed files with 3 additions and 18 deletions

View File

@ -1,9 +1,10 @@
# Multi Version: 16.0.0 - Getting the priorities straight # Multi Version: 16.0.0 - Connecting the dots
**Key Changes** **Key Changes**
- Expanded connection logic - Expanded connection logic
- New integration priorityManager - New integration priorityManager
- Tests for threads - Tests for threads
- Consistent behavior between the threading integrations - Consistent behavior between the threading integrations
- Improved love2d threading
- Bug fixes - Bug fixes
Found an issue? Please [submit it](https://github.com/rayaman/multi/issues) and someone will look into it! Found an issue? Please [submit it](https://github.com/rayaman/multi/issues) and someone will look into it!

View File

@ -60,14 +60,6 @@ Table of contents
# Update 16.0.0 - Getting the priorities straight # Update 16.0.0 - Getting the priorities straight
Full Update Showcase
---
```lua
multi, thread = require("multi"):init{print=true}
GLOBAL, THREAD = require("multi.integration.lanesManager"):init()
```
## Added New Integration: **priorityManager** ## Added New Integration: **priorityManager**
Allows the user to have multi auto set priorities (Requires chronos). Also adds the functionality to create your own runners (multi:mainloop(), multi:umanager()) that you can set using the priority manager. Even if you do not have `chronos` installed all other features will still work! Allows the user to have multi auto set priorities (Requires chronos). Also adds the functionality to create your own runners (multi:mainloop(), multi:umanager()) that you can set using the priority manager. Even if you do not have `chronos` installed all other features will still work!

View File

@ -45,31 +45,22 @@ end
local function getPriority(obj) local function getPriority(obj)
local avg = average(obj.__profiling) local avg = average(obj.__profiling)
if avg < 0.0002 then if avg < 0.0002 then
multi.print("Setting priority to: core")
return PList[1] return PList[1]
elseif avg < 0.0004 then elseif avg < 0.0004 then
multi.print("Setting priority to: very high")
return PList[2] return PList[2]
elseif avg < 0.0008 then elseif avg < 0.0008 then
multi.print("Setting priority to: high")
return PList[3] return PList[3]
elseif avg < 0.001 then elseif avg < 0.001 then
multi.print("Setting priority to: above normal")
return PList[4] return PList[4]
elseif avg < 0.0025 then elseif avg < 0.0025 then
multi.print("Setting priority to: normal")
return PList[5] return PList[5]
elseif avg < 0.005 then elseif avg < 0.005 then
multi.print("Setting priority to: below normal")
return PList[6] return PList[6]
elseif avg < 0.008 then elseif avg < 0.008 then
multi.print("Setting priority to: low")
return PList[7] return PList[7]
elseif avg < 0.01 then elseif avg < 0.01 then
multi.print("Setting priority to: very low")
return PList[8] return PList[8]
else else
multi.print("Setting priority to: idle")
return PList[9] return PList[9]
end end
end end

View File

@ -36,6 +36,7 @@ build = {
["multi.integration.luvitManager"] = "integration/luvitManager.lua", ["multi.integration.luvitManager"] = "integration/luvitManager.lua",
["multi.integration.threading"] = "integration/threading.lua", ["multi.integration.threading"] = "integration/threading.lua",
["multi.integration.sharedExtensions"] = "integration/sharedExtensions/init.lua", ["multi.integration.sharedExtensions"] = "integration/sharedExtensions/init.lua",
["multi.integration.priorityManager"] = "integration/priorityManager/init.lua",
--["multi.integration.networkManager"] = "integration/networkManager.lua", --["multi.integration.networkManager"] = "integration/networkManager.lua",
} }
} }