120 Commits
Author SHA1 Message Date
server 7b0cb7a853 added priorityManager to rockspec 2024-02-24 23:57:42 -05:00
server ffaab32d5e Cleaned up changes.md 2024-02-24 23:27:27 -05:00
server 946217310f lanes uses a threaded function like waitfor function 2024-02-24 23:23:35 -05:00
server b4c3708f50 Fixed, conf 2024-02-24 23:13:48 -05:00
server e3ac0951ab Threading working in love2d 2024-02-24 23:05:05 -05:00
server 42b4e0fcf4 Added test for defer 2023-11-26 22:13:18 -05:00
server f07b1ebb57 Fixed typo 2023-11-26 21:12:44 -05:00
server ea6503d7b2 Fixed issues 2023-11-26 21:10:37 -05:00
server b7a7e5bf16 Add test for rockspec 2023-11-26 20:57:59 -05:00
server 5ac17f8e59 Testing paths 2023-11-26 13:14:02 -05:00
server 2b9f732d88 Working on paths 2023-11-26 13:10:16 -05:00
server 726f55e5c6 Fixed paths 2023-11-26 12:59:54 -05:00
server 91561f7f24 Fixed tests on lanes and pseudo threading, todo fix love2d threading 2023-11-26 12:49:23 -05:00
server 8d843a5958 Added thread.defer(func) 2023-11-09 22:04:11 -05:00
server 30db370cc9 Updated changes.md and fixed some bugs 2023-11-02 23:59:34 -04:00
server 0af807a930 Fixed newTask() 2023-11-02 09:31:09 -04:00
server 9ad2c45b8f Document new features to conns, todo fix newTask 2023-11-01 23:37:00 -04:00
server e7ff234cef Merge branch 'v16.0.0' of https://github.com/rayaman/multi into v16.0.0 2023-10-28 17:57:29 -04:00
server f540396932 Added boost method 2023-10-28 17:57:21 -04:00
server 46ace58ab8 Added function / connection 2023-10-17 21:37:33 -04:00
server ef7464f70d Working on getting pseudoThreading tests to work 2023-10-15 13:21:57 -04:00
server ad929da484 Some work on the debug manager, proxies working on lanes, todo get pseudo manager and love2d working 2023-10-03 22:21:37 -04:00
server 3d55704726 Planning out debugManager 2023-09-07 21:17:15 -04:00
server 13221ca47e Test for 5.1 2023-09-04 19:50:50 -04:00
server 98198a4af2 Fixed error code issue 2023-09-04 19:48:13 -04:00
server 5f5723e936 Working on new type system, planning out debugmanager 2023-09-04 12:03:00 -04:00
server a660b63581 Closer to getting things working... 2023-08-06 00:38:22 -04:00
server bab9b13cb8 Push error when an error happens 2023-08-03 23:40:43 -04:00
server 8c2bde7ed8 Should now push non 0 exit codes 2023-08-03 23:33:16 -04:00
server d50c187710 Not hard crashing when error is encountered 2023-08-03 23:22:01 -04:00
server 5359be0772 testing... 2023-08-03 23:11:32 -04:00
server 59cbeb6597 Fixed packing of values into threads, need to fix system proxies and system threaded processors 2023-08-01 23:45:06 -04:00
server bb0592f3eb new pack/unpack for tables, current issue is things being turned into strings 2023-07-30 00:47:27 -04:00
server bbaac2d779 jobqueues having isues with stp 2023-07-17 00:44:59 -04:00
server 9e6552d42e Working on adding a Hold method to all objects. Will document how they all work when done. 2023-07-16 11:10:35 -04:00
server afdd98ab13 Rewriting love2d threading binding 2023-07-15 01:16:03 -04:00
server e43fe34a7c Still implementing new love2d threading code 2023-07-10 15:54:36 -04:00
server f4cdde6040 Rewriting loveManager, too much outdated code 2023-07-09 21:54:01 -04:00
server cec53f6f4e Added timeout to build 2023-07-04 23:56:56 -04:00
server d57dc7dc22 Edited symlink 2023-07-04 23:45:43 -04:00
server 6be948f068 Removed link 2023-07-04 23:43:40 -04:00
server c8abadd8d6 Update multi 2023-07-04 23:41:17 -04:00
server 15bbec9379 Fixed pull 2023-07-04 23:39:40 -04:00
server befe863846 packagepath set 2023-07-04 23:38:30 -04:00
server 761e739e18 actually pull the repo 2023-07-04 23:32:03 -04:00
server a9673385d9 Moved other tests while testing 2023-07-04 23:30:15 -04:00
server 0b0f971802 Use workspace 2023-07-04 23:28:54 -04:00
server 755f207554 Testing love2d 2023-07-04 23:26:37 -04:00
server 49a1b944d0 Fixed love2d tests 2023-07-04 23:25:08 -04:00
server 883bdb9830 No window for love2d 2023-07-04 23:20:00 -04:00
server 8a83c617fa use sudo 2023-07-04 23:16:03 -04:00
server 06580e0bfa Use appimage 2023-07-04 23:14:24 -04:00
server 0a72f16e68 Fixed path 2023-07-04 23:07:30 -04:00
server 721571d1a4 Use ubuntu for build 2023-07-04 23:05:37 -04:00
server 7c95b2e8ca Use later love-build 2023-07-04 23:04:06 -04:00
server a6fac9d1d4 Test love2d 2023-07-04 23:00:48 -04:00
server 7ba642342d Testing love2d tests 2023-07-04 22:49:06 -04:00
server acc94ea17e Removed system threaded connections, soon to be replaced by proxies 2023-07-04 16:00:37 -04:00
server 81fc7b95c9 Fixed issue with errors not going through 2023-07-04 13:46:25 -04:00
server 03a2f686a8 fixing stuff 2023-07-04 13:32:38 -04:00
server 96cc41effb Throw an error when things break 2023-07-04 13:25:18 -04:00
server 8c987b81ab typo fixed 2023-07-04 13:20:23 -04:00
server 1064d8a1cc fixing actions 2023-07-04 13:12:23 -04:00
server cd4cc5fd2d Testing... 2023-07-04 13:10:12 -04:00
server 614e032aa5 Testing actions, fixing bugs with lanes 2023-07-04 13:05:07 -04:00
server b2569118a2 Started work on the debugManager 2023-06-30 16:14:21 -04:00
server d36204c87f Merge pull request #59 from rayaman/compare
Compare
2023-06-25 21:48:41 -04:00
server 660c10ec3b Removed extra bloat, proxies are portable now! 2023-06-25 21:46:37 -04:00
server c39aa229f8 Fixed critical issue with coroutine based threads 2023-06-20 00:05:12 -04:00
server c80f44c68e Debugging what is going on... 2023-06-19 00:24:07 -04:00
server 1b3e3303e9 Really close to portable proxies, currently extreamly unstable! 2023-06-18 00:08:51 -04:00
server 6fe10b22ab Testing 2023-06-17 21:33:34 -04:00
server 257ed03728 THREAD_NAME set for main thread, connections break the rules for proxies 2023-06-03 12:07:33 -04:00
server 5e2ab9af3d Added an easy way to share a table, found some limitations with lanes threading. 2023-05-31 21:51:47 -04:00
server d520e0a93a Fixed some bugs 2023-05-30 23:50:36 -04:00
server 03ecb47f6f Finished getLoad(type) 2023-05-29 01:29:12 -04:00
server 3effcb7384 Getting loads of processors implemented 2023-05-28 00:37:17 -04:00
server 06c31bee85 Clean up connection events when holding, working on scheduling tasks/threads to system threaded processors 2023-05-27 23:57:58 -04:00
server 5c03b34290 thread.hold(proxy.conn) 2023-05-27 00:10:21 -04:00
server af38ebbb81 Added tstep to STP, updated changes.md 2023-05-24 23:31:07 -04:00
server de9b08fa2e Proxies work with connections now :D 2023-05-24 23:17:18 -04:00
server ab9e949b68 newProxy implemented 2023-05-21 09:43:44 -04:00
server ea4be86ae2 newProxy and STP work 2023-05-16 23:40:14 -04:00
server 160c72d2f3 Working on systemthreadedprocess, and experimental newProxy for threading 2023-05-14 00:52:35 -04:00
server 5caa90f6c7 updated changes.md 2023-05-07 23:04:06 -04:00
server a5add93747 Changes to threads 2023-05-07 23:03:15 -04:00
server ec9f7dec61 Trying to fix exposeENV with pseudoThreading 2023-05-07 01:31:29 -04:00
server e616b51d6f fixing 2023-05-07 00:24:07 -04:00
server cfa4c0f0b6 Fixed typo in pseudoManager 2023-05-07 00:19:34 -04:00
server 9f3b663fa2 Typo in changes.md 2023-05-06 16:52:48 -04:00
server 4fe428e572 THREAD.exposeENV(), thread:newProcessor() 2023-05-06 16:46:15 -04:00
server 5cc18b04ae Threaded processors 2023-05-06 03:18:00 -04:00
server 33202260e3 Fixed issues with missing code 2023-05-05 16:33:31 -04:00
server 189552ac65 Working on custom prioritySchemes 2023-05-03 23:09:37 -04:00
server 42149ffab2 Working on priority management 2023-04-30 23:53:54 -04:00
server 03dbe1ee5b Working on new priority scheme 2023-04-30 01:06:20 -04:00
server 8cf047d713 removed extra __cores in lanes/pseudo 2023-04-29 13:47:25 -04:00
server 9e1d31fc2a Modified tests to make it more seamless 2023-04-25 22:32:24 -04:00
server 0e6c30b478 Updated files for testing 2023-04-25 22:05:32 -04:00
server d8218f0bf7 All tests working 2023-04-25 21:57:25 -04:00
server 45b51c15c7 Fixed love2d to succeed with tests 2023-04-25 21:31:36 -04:00
server 61b5ea9d14 Added test cases for threading, fixed issues. Todo test love2d 2023-04-25 00:13:47 -04:00
server d2cfdfa8e8 Writing tests for system threading 2023-04-24 00:15:35 -04:00
server 8e6d174f20 Plan on testing parity between the threading modules 2023-04-20 23:23:51 -04:00
server c65b850529 Updated changes.md 2023-04-04 23:07:39 -04:00
server a105d8a575 removed test 2023-01-22 23:04:09 -05:00
server 7da192e8dc Fixed some issues with threads 2023-01-21 13:18:44 -05:00
server ef9267d8fc Fixed broken threads for love 2023-01-20 00:11:55 -05:00
server 0994ee2d2a Working on issue where threads created in threads don't work 2023-01-19 00:16:32 -05:00
server 22f1375380 Working on issue with love threaded functions not waiting when in a thread 2023-01-18 15:42:38 -05:00
server 6ed5555706 Fixed issue with double thread activations (Looking for another solution) 2023-01-17 23:45:26 -05:00
server a7a902acd6 Updated connections 2023-01-15 13:28:45 -05:00
server 3776fdff9d Connections can be % with functions 2023-01-11 22:53:03 -05:00
server 7114b87bdd Testing types 2023-01-10 00:07:12 -05:00
server 0bccc0dd87 Concat conns now properly transfer events 2023-01-07 09:57:31 -05:00
server cf980951a4 Updated version 2023-01-07 01:35:32 -05:00
server a81e55f41c Updated readme 2023-01-07 01:34:41 -05:00
server 5cf3947b15 Updated files 2023-01-07 01:32:22 -05:00
server 298529edc2 Merge branch 'master' into v16.0.0 2023-01-07 01:26:29 -05:00
server 5137bb9483 Fixed spelling, started ideaing for 16.0.0 2022-12-31 17:06:04 -05:00
100 changed files with 28622 additions and 30512 deletions
+25
View File
@@ -0,0 +1,25 @@
name: Build & Run tests Love2d
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install love2d
run: |
sudo apt install fuse
wget https://github.com/love2d/love/releases/download/11.4/love-11.4-x86_64.AppImage -O love.AppImage
sudo chmod +x love.AppImage
- name: Run Tests
run: |
./love.AppImage tests
+26 -17
View File
@@ -1,4 +1,4 @@
name: Lua Unit Tests (Matrix)
name: Build & Run tests Ubuntu
on:
push:
@@ -7,26 +7,35 @@ on:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
build:
strategy:
fail-fast: false
matrix:
luaVersion: ["5.1", "5.2", "5.3", "5.4"]
build-type: [Release] # Debug
lua: ["lua 5.1", "lua 5.2", "lua 5.3", "lua 5.4", "luajit 2.1.0-beta3"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Lua
uses: leafo/gh-actions-lua@v10
- uses: actions/checkout@v2
with:
luaVersion: ${{ matrix.luaVersion }}
submodules: recursive
- name: Verify Lua version
run: lua -v
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Run unit tests
- name: Setup env
run: |
# Replace with your actual test file
lua tests/multi_test.lua
pip install hererocks
hererocks lua-pkg --${{ matrix.lua }} -rlatest
- name: Install lanes and multi
run: |
source ${{github.workspace}}/lua-pkg/bin/activate
luarocks install lanes
luarocks install rockspecs/multi-16.0-0.rockspec
- name: Run Tests
run: |
source ${{github.workspace}}/lua-pkg/bin/activate
lua tests/runtests.lua
+9 -8
View File
@@ -1,10 +1,11 @@
# Multi Version: 16.3.0 -
# Multi Version: 16.0.0 - Connecting the dots
**Key Changes**
- Fixed connection multiplying
- Optimizing the library
- Updated task management support
Refer to the [Change Log](https://github.com/rayaman/multi/blob/master/docs/changes.md) for more infromation
- Expanded connection logic
- New integration priorityManager
- Tests for threads
- Consistent behavior between the threading integrations
- Improved love2d threading
- Bug fixes
Found an issue? Please [submit it](https://github.com/rayaman/multi/issues) and someone will look into it!
@@ -12,7 +13,7 @@ My multitasking library for lua. It is a pure lua binding, with exceptions of th
</br>
Progress is being made in [v16.3.0](https://github.com/rayaman/multi/tree/v16.3.0)
Progress is being made in [v16.0.0](https://github.com/rayaman/multi/tree/v16.0.0)
---
</br>
@@ -51,7 +52,7 @@ Planned features/TODO
- [x] ~~Create test suite (In progress, mostly done)~~
- [ ] Network Parallelism rework
Usage: [Check out the documentation for more info](https://github.com/rayaman/multi/blob/master/docs/Documentation.md)
Usage: [Check out the documentation for more info](https://github.com/rayaman/multi/blob/master/Documentation.md)
-----
You can run tests in 2 ways:
-193
View File
@@ -1,10 +1,6 @@
# Changelog
Table of contents
---
[Update 16.3.0 - Proper Priorities](#update-1620---proper-priorities)</br>
[Update 16.2.0 - TimeStamps and UUIDs](#update-1620---timestamps-and-uuids)</br>
[Update 16.1.0 - The Flow State](#update-1610---the-flow-state)</br>
[Update 16.0.1 - Bug fix](#update-1601---bug-fix)</br>
[Update 16.0.0 - Connecting the dots](#update-1600---getting-the-priorities-straight)</br>
[Update 15.3.1 - Bug fix](#update-1531---bug-fix)</br>
[Update 15.3.0 - A world of connections](#update-1530---a-world-of-connections)</br>
@@ -62,195 +58,6 @@ Table of contents
[Update: EventManager 1.0.0 - Error checking](#update-eventmanager-100---error-checking)</br>
[Version: EventManager 0.0.1 - In The Beginning things were very different](#version-eventmanager-001---in-the-beginning-things-were-very-different)
# Update 16.3.0 - Proper Priorities
Added
---
- New processor scoped to track connections that exist
- Better Destroy logic for connections
- Added UPTIME to all objects in the library via the create hook
- added `proc:isPaused()` to processors
- `multi.setClock(c)` allows you to set the internal clock used by the multi core. For example on linux os.clock doesn't give time elapsed since the program started like it does on windows. This method allows one to swap that out.
Changed
---
- `thread.kill(msg)` now accepts a message. If omitted will use default `thread killed!`
- Modified multiple locations to not create a function during a thread.hold() and reuse. Only functions containing an upvalue currently have functions being created during hold. This will eventually be fixed
- Updated `multi:getStats()` with more information
- `multi.forwardConnection()` now returns the link to the source connection so you can do cleanup
- When connecting to a connection you can unconnect using ref:Unconnect() it has an internal reference to the root connection
- Unnamed threads have a shorter postfix of only 4 random characters
Fixed
---
- [Issue](https://github.com/rayaman/multi/issues/77) with concat of connections where conn .. func did not work properly
- [Issue](https://github.com/rayaman/multi/issues/67) with connection multiplying
# Update 16.2.0 - TimeStamps and UUIDs and bugfixes
Added
---
- threadedfunctions, multiobjs and threads contain new method: `GetCreationTimestamp()` With will return a string formated date time using ISO 8601
Changed
---
- Internal uuid functions to not use bitwise operators
Fixed
---
- [Bitwise operations break lua 5.1/luajit](https://github.com/rayaman/multi/issues/73)
# Update 16.1.0 - The Flow State
Added
---
- `multi.UUID()` generates a uuid7, if chronos is installed that will be used as the initial time seed
- `More control over processors`
- `multi:newProcessor(name, opts, priority)` -- Now accepts a opts table. Old param still works
| Option | Description | Default |
| --- | --- | --- |
| Attach | If true a hook will be attached to the parent process and will run when Start is called or Start is set | false |
| MaxObjects | Maximum number of objects that a processor can spawn | -1 (disabled) |
| MaxThreads | Maximum number of threads that a processor can spawn | -1 (disabled) |
| Start | If true the processor will start instantlly | false |
| Priority | If true the processor will use the priority handler | false |
| TaskDelay | Sets the task delay in seconds between each tasks execution | 0 |
| TashHandler | If false will disable the task feature of a processor | true |
- `proc:newThread()` returns nil, "errorstring" if it was unable to create a thread
- `proc:new[Object]` now returns {unscheduled}, "errorstring", used to just return the {scheduledObject} and no errorstring
- `proc:getMaxThreads()` -- returns the max thread limit
- `proc:setMaxThreads(n)` -- sets the max thread limit
- `proc:getMaxObjects()` -- gets the max object limit
- `proc:setMaxObjects(n)` -- sets the max object limit
- `proc.Status` -- A table that contains all status errors that occured in a process
Example:
```lua
local multi, thread = require("multi"):init()
proc = multi:newProcessor("thread test",{
Start = true,
MaxThreads = 1,
MaxObjects = 1,
Attach = true,
TaskDelay = .1,
Priority = true,
TaskHandler = false
})
print(proc:newThread("testing",function()
while true do
print("STATUS:\n---")
for i,v in ipairs(proc.Status) do
print(i,v)
end
thread.sleep(1)
end
end))
proc:newThread("testing 2",function()
while true do
print("testing 2...")
thread.sleep(1)
end
end)
proc:newThread("testing 3",function()
while true do
print("testing 3...")
thread.sleep(1)
end
end)
proc:newLoop(function()
--
end)
print(proc:newLoop(function()
--
end))
multi:mainloop()
```
- `multi.hasType(typ)` returns true if a type has been registered
- `multi.isMultiObj(obj)` returns true if the object is a multi object
- `multi.forwardConnection(src, dest)` forwards events from one connection to another connection. Doesn't modify anything and both connections are triggered when src is Fired, but not when dest is fired.
- `multi.isTimeout(res)` returns true if the response it gets is a timeout type or a string equal to `multi.TIMEOUT`'s value
- `multi:newTimeout(seconds)` returns a connection that will trigger after a certain amount of time. See example below:
```lua
local multi, thread = require("multi"):init()
data = multi:newConnection()
-- This alarm takes too long... We will timeout
multi:newAlarm(4):OnRing(function()
data:Fire({Type="request"},"data is tasty")
end)
multi:newThread(function()
res, data = thread.hold(data + multi:newTimeout(3)) -- combined connections allow this to work
if multi.isTimeout(res) then
print("We timed out!")
else
print("We got the data:", data)
end
os.exit()
end)
multi:mainloop()
```
- `connection % function` can now modify the arguments of a connection. See above example modified below
```lua
local multi, thread = require("multi"):init()
local data = multi:newAlarm(1).OnRing % function() return {Type="request"}, "data is tasty" end
multi:newThread(function()
res, data = thread.hold(data + multi:newTimeout(3))
if multi.isTimeout(res) then
print("We timed out!")
else
print("We got the data:", data)
end
os.exit()
end)
multi:mainloop()
```
If the alarm takes longer the the timeout: `We timed out!` If the alarm is shorter: `We got the data: data is tasty`
Changed
---
- `multi:newBase(tp,ins,callback)` now accepts a tp param and a callback function. Callback is expected to return true/false, errorstring. If callback is false it will cancel scheduling of an object. If type is set the type of the object will be set.
**Note:** This is all internal functionality
# Update 16.0.1 - Bug fix
Fixed
---
- thread.pushStatus() wasn't properly working when forwarding events from THREAD.pushStatus OnStatus connection. This bug also caused stack overflow errors with the following code
```lua
func = thread:newFunction(function()
for i=1,10 do
thread.sleep(1)
thread.pushStatus(i)
end
end)
func2 = thread:newFunction(function()
local ref = func()
ref.OnStatus(function(num)
-- do stuff with this data
thread.pushStatus(num*2) -- Technically this is not ran within a thread. This is ran outside of a thread inside the thread handler.
end)
end)
local handler = func2()
handler.OnStatus(function(num)
print(num)
end)
multi:mainloop()
```
# Update 16.0.0 - Getting the priorities straight
## Added New Integration: **priorityManager**
File diff suppressed because it is too large Load Diff
+108 -521
View File
File diff suppressed because it is too large Load Diff
+6 -10
View File
@@ -58,20 +58,16 @@ function multi:newSystemThreadedQueue(name)
GLOBAL[name] = c
end
local peek = function()
return c:peek()
end
local pop = function()
return c:pop()
end
function c:Hold(opt)
local multi, thread = require("multi"):init()
if opt.peek then
return thread.hold(peek)
return thread.hold(function()
return self:peek()
end)
else
return thread.hold(pop)
return thread.hold(function()
return self:pop()
end)
end
end
+2
View File
@@ -23,7 +23,9 @@ SOFTWARE.
]]
package.path = "?/init.lua;?.lua;" .. package.path
local multi, thread = require("multi"):init()
local pseudoProcessor = multi:newProcessor()
if multi.integration then
return {
init = function()
-1
View File
@@ -1 +0,0 @@
-- Allows the creation of states
-42
View File
@@ -1,42 +0,0 @@
package = "multi"
version = "16.0-1"
source = {
url = "git://github.com/rayaman/multi.git",
tag = "v16.0.1",
}
description = {
summary = "Lua Multi tasking library",
detailed = [[
This library contains many methods for multi tasking. Features non coroutine based multi-tasking, coroutine based multi-tasking, and system threading (Requires use of an integration).
Check github for documentation.
]],
homepage = "https://github.com/rayaman/multi",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
["multi"] = "init.lua",
["multi.integration.lanesManager"] = "integration/lanesManager/init.lua",
["multi.integration.lanesManager.extensions"] = "integration/lanesManager/extensions.lua",
["multi.integration.lanesManager.threads"] = "integration/lanesManager/threads.lua",
["multi.integration.loveManager"] = "integration/loveManager/init.lua",
["multi.integration.loveManager.extensions"] = "integration/loveManager/extensions.lua",
["multi.integration.loveManager.threads"] = "integration/loveManager/threads.lua",
["multi.integration.loveManager.utils"] = "integration/loveManager/threads.lua",
--["multi.integration.lovrManager"] = "integration/lovrManager/init.lua",
--["multi.integration.lovrManager.extensions"] = "integration/lovrManager/extensions.lua",
--["multi.integration.lovrManager.threads"] = "integration/lovrManager/threads.lua",
["multi.integration.pseudoManager"] = "integration/pseudoManager/init.lua",
["multi.integration.pseudoManager.extensions"] = "integration/pseudoManager/extensions.lua",
["multi.integration.pseudoManager.threads"] = "integration/pseudoManager/threads.lua",
["multi.integration.luvitManager"] = "integration/luvitManager.lua",
["multi.integration.threading"] = "integration/threading.lua",
["multi.integration.sharedExtensions"] = "integration/sharedExtensions/init.lua",
["multi.integration.priorityManager"] = "integration/priorityManager/init.lua",
--["multi.integration.networkManager"] = "integration/networkManager.lua",
}
}
-42
View File
@@ -1,42 +0,0 @@
package = "multi"
version = "16.1-0"
source = {
url = "git://github.com/rayaman/multi.git",
tag = "v16.1.0",
}
description = {
summary = "Lua Multi tasking library",
detailed = [[
This library contains many methods for multi tasking. Features non coroutine based multi-tasking, coroutine based multi-tasking, and system threading (Requires use of an integration).
Check github for documentation.
]],
homepage = "https://github.com/rayaman/multi",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
["multi"] = "init.lua",
["multi.integration.lanesManager"] = "integration/lanesManager/init.lua",
["multi.integration.lanesManager.extensions"] = "integration/lanesManager/extensions.lua",
["multi.integration.lanesManager.threads"] = "integration/lanesManager/threads.lua",
["multi.integration.loveManager"] = "integration/loveManager/init.lua",
["multi.integration.loveManager.extensions"] = "integration/loveManager/extensions.lua",
["multi.integration.loveManager.threads"] = "integration/loveManager/threads.lua",
["multi.integration.loveManager.utils"] = "integration/loveManager/threads.lua",
--["multi.integration.lovrManager"] = "integration/lovrManager/init.lua",
--["multi.integration.lovrManager.extensions"] = "integration/lovrManager/extensions.lua",
--["multi.integration.lovrManager.threads"] = "integration/lovrManager/threads.lua",
["multi.integration.pseudoManager"] = "integration/pseudoManager/init.lua",
["multi.integration.pseudoManager.extensions"] = "integration/pseudoManager/extensions.lua",
["multi.integration.pseudoManager.threads"] = "integration/pseudoManager/threads.lua",
["multi.integration.luvitManager"] = "integration/luvitManager.lua",
["multi.integration.threading"] = "integration/threading.lua",
["multi.integration.sharedExtensions"] = "integration/sharedExtensions/init.lua",
["multi.integration.priorityManager"] = "integration/priorityManager/init.lua",
--["multi.integration.networkManager"] = "integration/networkManager.lua",
}
}
-42
View File
@@ -1,42 +0,0 @@
package = "multi"
version = "16.2-0"
source = {
url = "git://github.com/rayaman/multi.git",
tag = "v16.2.0",
}
description = {
summary = "Lua Multi tasking library",
detailed = [[
This library contains many methods for multi tasking. Features non coroutine based multi-tasking, coroutine based multi-tasking, and system threading (Requires use of an integration).
Check github for documentation.
]],
homepage = "https://github.com/rayaman/multi",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
["multi"] = "init.lua",
["multi.integration.lanesManager"] = "integration/lanesManager/init.lua",
["multi.integration.lanesManager.extensions"] = "integration/lanesManager/extensions.lua",
["multi.integration.lanesManager.threads"] = "integration/lanesManager/threads.lua",
["multi.integration.loveManager"] = "integration/loveManager/init.lua",
["multi.integration.loveManager.extensions"] = "integration/loveManager/extensions.lua",
["multi.integration.loveManager.threads"] = "integration/loveManager/threads.lua",
["multi.integration.loveManager.utils"] = "integration/loveManager/threads.lua",
--["multi.integration.lovrManager"] = "integration/lovrManager/init.lua",
--["multi.integration.lovrManager.extensions"] = "integration/lovrManager/extensions.lua",
--["multi.integration.lovrManager.threads"] = "integration/lovrManager/threads.lua",
["multi.integration.pseudoManager"] = "integration/pseudoManager/init.lua",
["multi.integration.pseudoManager.extensions"] = "integration/pseudoManager/extensions.lua",
["multi.integration.pseudoManager.threads"] = "integration/pseudoManager/threads.lua",
["multi.integration.luvitManager"] = "integration/luvitManager.lua",
["multi.integration.threading"] = "integration/threading.lua",
["multi.integration.sharedExtensions"] = "integration/sharedExtensions/init.lua",
["multi.integration.priorityManager"] = "integration/priorityManager/init.lua",
--["multi.integration.networkManager"] = "integration/networkManager.lua",
}
}
+39
View File
@@ -0,0 +1,39 @@
function love.conf(t)
t.identity = nil -- The name of the save directory (string)
t.version = "12.0" -- The LOVE version this game was made for (string)
t.console = true -- Attach a console (boolean, Windows only)
t.window.title = "MultiThreadTest" -- The window title (string)
t.window.icon = nil -- Filepath to an image to use as the window's icon (string)
t.window.width = 1280 -- The window width (number)
t.window.height = 720 -- The window height (number)
t.window.borderless = false -- Remove all border visuals from the window (boolean)
t.window.resizable = true -- Let the window be user-resizable (boolean)
t.window.minwidth = 1 -- Minimum window width if the window is resizable (number)
t.window.minheight = 1 -- Minimum window height if the window is resizable (number)
t.window.fullscreen = false -- Enable fullscreen (boolean)
t.window.fullscreentype = "desktop" -- Standard fullscreen or desktop fullscreen mode (string)
t.window.vsync = false -- Enable vertical sync (boolean)
t.window.fsaa = 2 -- The number of samples to use with multi-sampled antialiasing (number)
t.window.display = 1 -- Index of the monitor to show the window in (number)
t.window.highdpi = false -- Enable high-dpi mode for the window on a Retina display (boolean)
t.window.srgb = false -- Enable sRGB gamma correction when drawing to the screen (boolean)
t.window.x = nil -- The x-coordinate of the window's position in the specified display (number)
t.window.y = nil -- The y-coordinate of the window's position in the specified display (number)
t.modules.audio = false -- Enable the audio module (boolean)
t.modules.event = false -- Enable the event module (boolean)
t.modules.graphics = false -- Enable the graphics module (boolean)
t.modules.image = false -- Enable the image module (boolean)
t.modules.joystick = false -- Enable the joystick module (boolean)
t.modules.keyboard = false -- Enable the keyboard module (boolean)
t.modules.math = false -- Enable the math module (boolean)
t.modules.mouse = false -- Enable the mouse module (boolean)
t.modules.physics = false -- Enable the physics module (boolean)
t.modules.sound = false -- Enable the sound module (boolean)
t.modules.system = false -- Enable the system module (boolean)
t.modules.timer = false -- Enable the timer module (boolean)
t.modules.window = false -- Enable the window module (boolean)
t.modules.thread = true -- Enable the thread module (boolean)
end
-244
View File
@@ -1,244 +0,0 @@
--[[
Test suite for multi.lua
Run with: lua multi_test.lua
Requires multi.lua to be in the same directory or on the Lua path.
Compatible with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT.
]]
package.path = "../?/init.lua;../?.lua;../init.lua;../?.lua;" .. package.path
-- ─────────────────────────────────────────────
-- Minimal test runner
-- ─────────────────────────────────────────────
local passed, failed, skipped = 0, 0, 0
local failures = {}
local function test(name, fn)
local ok, err = pcall(fn)
if ok then
passed = passed + 1
io.write("\x1b[92m ✓\x1b[0m " .. name .. "\n")
else
failed = failed + 1
table.insert(failures, {name = name, err = tostring(err)})
io.write("\x1b[91m ✗\x1b[0m " .. name .. "\n")
io.write(" " .. tostring(err) .. "\n")
end
end
local function skip(name, reason)
skipped = skipped + 1
io.write("\x1b[93m -\x1b[0m " .. name .. " [SKIPPED: " .. (reason or "") .. "]\n")
end
local function section(name)
io.write("\n\x1b[97m── " .. name .. " ──\x1b[0m\n")
end
local function assert_eq(a, b, msg)
if a ~= b then
error((msg or "assert_eq failed") .. ": expected " .. tostring(b) .. ", got " .. tostring(a), 2)
end
end
local function assert_truthy(v, msg)
if not v then
error((msg or "expected truthy value, got falsy") .. ": " .. tostring(v), 2)
end
end
local function assert_falsy(v, msg)
if v then
error((msg or "expected falsy value, got truthy") .. ": " .. tostring(v), 2)
end
end
local function assert_type(v, t, msg)
if type(v) ~= t then
error((msg or "type mismatch") .. ": expected " .. t .. ", got " .. type(v), 2)
end
end
-- ─────────────────────────────────────────────
-- Load the library
-- ─────────────────────────────────────────────
local multi, thread
local ok, err = pcall(function()
multi, thread = require("multi"):init()
end)
if not ok then
io.write("\x1b[91mFATAL: Could not load multi.lua: " .. tostring(err) .. "\x1b[0m\n")
io.write("Make sure multi.lua is in the same directory or on package.path.\n")
os.exit(1)
end
-- Helper: run the scheduler for up to `max_ticks` ticks or until `done()` returns true.
local function run_until(done, max_ticks)
max_ticks = max_ticks or 10000
for _ = 1, max_ticks do
multi:uManager()
if done and done() then return true end
end
return done == nil
end
section("Initialization")
test("lanesManager init returns GLOBAL and THREAD", function()
local GLOBAL, THREAD = require("multi.integration.lanesManager"):init()
assert_type(GLOBAL, "table")
assert_type(THREAD, "table")
end)
test("lanesManager sets integration table", function()
assert_type(multi.integration.GLOBAL, "table")
assert_type(multi.integration.THREAD, "table")
end)
-- initialize once for rest of tests
local GLOBAL, THREAD = require("multi.integration.lanesManager"):init()
-- ─────────────────────────────────────────────
section("SystemThreadedQueue")
test("queue push/pop", function()
local q = multi:newSystemThreadedQueue("testQ1")
q:push(42)
local val = q:pop()
assert_eq(val, 42)
end)
test("queue peek does not remove", function()
local q = multi:newSystemThreadedQueue("testQ2")
q:push("hello")
assert_eq(q:peek(), "hello")
assert_eq(q:pop(), "hello")
end)
test("queue empty returns nil", function()
local q = multi:newSystemThreadedQueue("testQ3")
assert_eq(q:pop(), nil)
end)
-- ─────────────────────────────────────────────
section("SystemThreadedTable")
test("table set/get", function()
local t = multi:newSystemThreadedTable("testT1")
t.foo = "bar"
assert_eq(t.foo, "bar")
end)
test("table overwrite", function()
local t = multi:newSystemThreadedTable("testT2")
t.x = 1
t.x = 2
assert_eq(t.x, 2)
end)
-- ─────────────────────────────────────────────
section("THREAD API")
test("THREAD set/get", function()
THREAD.set("abc", 123)
assert_eq(THREAD.get("abc"), 123)
end)
test("THREAD getCores > 0", function()
assert_truthy(THREAD.getCores() > 0)
end)
-- ─────────────────────────────────────────────
section("SystemThreadedConnection")
test("connection fires event", function()
local conn = multi:newSystemThreadedConnection("conn1"):init()
local received = nil
conn(function(v)
received = v
end)
conn:Fire("ping")
run_until(function()
return received ~= nil
end, 5000)
assert_eq(received, "ping")
end)
-- ─────────────────────────────────────────────
section("SystemThreadedJobQueue")
test("job queue executes function", function()
local jq = multi:newSystemThreadedJobQueue(1)
jq:registerFunction("add", function(a, b)
return a + b
end)
local result = nil
jq.OnJobCompleted(function(_, val)
result = val
end)
jq:pushJob("add", 2, 3)
run_until(function()
return result ~= nil
end, 10000)
assert_eq(result, 5)
end)
-- ─────────────────────────────────────────────
section("JobQueue newFunction")
test("newFunction returns correct result", function()
local jq = multi:newSystemThreadedJobQueue(1)
local fn = jq:newFunction(function(a, b)
return a * b
end,true)
local result = nil
result = fn(3, 4)
run_until(function()
return result ~= nil
end, 10000)
assert_eq(result, 12)
end)
-- ─────────────────────────────────────────────
-- Summary
-- ─────────────────────────────────────────────
section("Results")
io.write("\n")
io.write("Passed: " .. passed .. "\n")
io.write("Failed: " .. failed .. "\n")
io.write("Skipped: " .. skipped .. "\n")
if failed > 0 then
io.write("\nFailures:\n")
for _, f in ipairs(failures) do
io.write(" - " .. f.name .. "\n")
io.write(" " .. f.err .. "\n")
end
os.exit(1)
end
+10
View File
@@ -0,0 +1,10 @@
package.path = "../?/init.lua;../?.lua;"..package.path
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
end
GLOBAL, THREAD = require("multi.integration.loveManager"):init()
require("runtests")
require("threadtests")
+1
View File
@@ -0,0 +1 @@
../
-1095
View File
File diff suppressed because it is too large Load Diff
+193
View File
@@ -0,0 +1,193 @@
package.path = "../?/init.lua;../?.lua;./init.lua;./?.lua;"..package.path
local multi, thread = require("multi"):init{print=true,warn=true,error=true}--{priority=true}
local good = false
local proc = multi:newProcessor("Test")
proc.Start()
proc:newAlarm(3):OnRing(function()
good = true
end)
runTest = thread:newFunction(function()
local alarms,tsteps,steps,loops,tloops,updaters,events=false,0,0,0,0,0,false
multi.print("Testing Basic Features. If this fails most other features will probably not work!")
proc:newAlarm(2):OnRing(function(a)
alarms = true
a:Destroy()
end)
proc:newTStep(1,10,1,.1):OnStep(function(t)
tsteps = tsteps + 1
end):OnEnd(function(step)
step:Destroy()
end)
proc:newStep(1,10):OnStep(function(s)
steps = steps + 1
end):OnEnd(function(step)
step:Destroy()
end)
local loop = proc:newLoop(function(l)
loops = loops + 1
end)
proc:newTLoop(function(t)
tloops = tloops + 1
end,.1)
local updater = proc:newUpdater(1):OnUpdate(function()
updaters = updaters + 1
end)
local event = proc:newEvent(function()
return alarms
end)
event.OnEvent(function(evnt)
evnt:Destroy()
events = true
multi.success("Alarms: Ok")
multi.success("Events: Ok")
if tsteps == 10 then multi.success("TSteps: Ok") else multi.error("TSteps: Bad!") end
if steps == 10 then multi.success("Steps: Ok") else multi.error("Steps: Bad!") end
if loops > 100 then multi.success("Loops: Ok") else multi.error("Loops: Bad!") end
if tloops > 10 then multi.success("TLoops: Ok") else multi.error("TLoops: Bad!") end
if updaters > 100 then multi.success("Updaters: Ok") else multi.error("Updaters: Bad!") end
end)
thread.hold(event.OnEvent)
multi.print("Starting Connection and Thread tests!")
func = thread:newFunction(function(count)
multi.print("Starting Status test: ",count)
local a = 0
while true do
a = a + 1
thread.sleep(.1)
thread.pushStatus(a,count)
if a == count then break end
end
return "Done", true, math.random(1,10000)
end)
local ret = func(10)
local ret2 = func(15)
local ret3 = func(20)
local s1,s2,s3 = 0,0,0
ret.OnError(function(...)
multi.error("Func 1:",...)
end)
ret2.OnError(function(...)
multi.error("Func 2:",...)
end)
ret3.OnError(function(...)
multi.error("Func 3:",...)
end)
ret.OnStatus(function(part,whole)
s1 = math.ceil((part/whole)*1000)/10
end)
ret2.OnStatus(function(part,whole)
s2 = math.ceil((part/whole)*1000)/10
end)
ret3.OnStatus(function(part,whole)
s3 = math.ceil((part/whole)*1000)/10
end)
ret.OnReturn(function(...)
multi.success("Done 1",...)
end)
ret2.OnReturn(function(...)
multi.success("Done 2",...)
end)
ret3.OnReturn(function(...)
multi.success("Done 3",...)
end)
local err, timeout = thread.hold(ret.OnReturn * ret2.OnReturn * ret3.OnReturn)
if s1 == 100 and s2 == 100 and s3 == 100 then
multi.success("Threads: All tests Ok")
else
if s1>0 and s2>0 and s3 > 0 then
multi.success("Thread OnStatus: Ok")
else
multi.error("Threads OnStatus or thread.hold(conn) Error!")
end
if timeout then
multi.error("Connection Error!")
else
multi.success("Connection Test 1: Ok")
end
multi.error("Connection holding Error!")
end
conn1 = proc:newConnection()
conn2 = proc:newConnection()
conn3 = proc:newConnection()
local c1,c2,c3,c4 = false,false,false,false
local a = conn1(function()
c1 = true
end)
local b = conn2(function()
c2 = true
end)
local c = conn3(function()
c3 = true
end)
local d = conn3(function()
c4 = true
end)
conn1:Fire()
conn2:Fire()
conn3:Fire()
if c1 and c2 and c3 and c4 then
multi.success("Connection Test 2: Ok")
else
multi.error("Connection Test 2: Error")
end
c3 = false
c4 = false
conn3:Unconnect(d)
conn3:Fire()
if c3 and not(c4) then
multi.success("Connection Test 3: Ok")
else
multi.error("Connection Test 3: Error removing connection")
end
if not love then
local ec = 0
multi.print("Testing pseudo threading")
capture = io.popen("lua tests/threadtests.lua p"):read("*a")
if capture:lower():match("error") then
ec = ec + 1
os.exit(1)
else
io.write(capture)
end
multi.print("Testing lanes threading")
capture = io.popen("lua tests/threadtests.lua l"):read("*a")
if capture:lower():match("error") then
ec = ec + 1
os.exit(1)
else
io.write(capture)
end
os.exit(0)
end
end)
local handle = runTest()
handle.OnError(function(...)
multi.error("Something went wrong with the test!")
print(...)
end)
if not love then
multi:mainloop()
else
local hold = thread:newFunction(function()
thread.hold(handle.OnError + handle.OnReturn)
end, true)
hold()
multi.print("Starting Threading tests!")
end
+298
View File
@@ -0,0 +1,298 @@
package.path = "../?/init.lua;../?.lua;"..package.path
multi, thread = require("multi"):init{print=true,warn=true,debugging=true}
-- for i,v in pairs(thread) do
-- print(i,v)
-- end
-- require("multi.integration.priorityManager")
-- multi.debugging.OnObjectCreated(function(obj, process)
-- multi.print("Created:", obj.Type, "in", process.Type, process:getFullName())
-- end)
-- multi.debugging.OnObjectDestroyed(function(obj, process)
-- multi.print("Destroyed:", obj.Type, "in", process.Type, process:getFullName())
-- end)
-- test = multi:newProcessor("Test")
-- test:setPriorityScheme(multi.priorityScheme.TimeBased)
-- test:newUpdater(10000000):OnUpdate(function()
-- print("Print is slowish")
-- end)
-- print("Running...")
-- local conn1, conn2 = multi:newConnection(), multi:newConnection()
-- conn3 = conn1 + conn2
-- conn1(function()
-- print("Hi 1")
-- end)
-- conn2(function()
-- print("Hi 2")
-- end)
-- conn3(function()
-- print("Hi 3")
-- end)
-- function test(a,b,c)
-- print("I run before all and control if execution should continue!")
-- return a>b
-- end
-- conn4 = test .. conn1
-- conn5 = conn2 .. function() print("I run after it all!") end
-- conn4:Fire(3,2,3)
-- -- This second one won't trigger the Hi's
-- conn4:Fire(1,2,3)
-- conn5(function()
-- print("Test 1")
-- end)
-- conn5(function()
-- print("Test 2")
-- end)
-- conn5(function()
-- print("Test 3")
-- end)
-- conn5:Fire()
-- multi.print("Testing thread:newProcessor()")
-- proc = thread:newProcessor("Test")
-- proc:newLoop(function()
-- multi.print("Running...")
-- thread.sleep(1)
-- end)
-- proc:newThread(function()
-- while true do
-- multi.warn("Everything is a thread in this proc!")
-- thread.sleep(1)
-- end
-- end)
-- proc:newAlarm(5):OnRing(function(a)
-- multi.print(";) Goodbye")
-- a:Destroy()
-- end)
-- local func = thread:newFunction(function()
-- thread.sleep(4)
-- print("Hello!")
-- end)
-- multi:newTLoop(func, 1)
-- multi:mainloop()
-- multi:setTaskDelay(.05)
-- multi:newTask(function()
-- for i = 1, 10 do
-- multi:newTask(function()
-- print("Task "..i)
-- end)
-- end
-- end)
-- local conn = multi:newConnection()
-- conn(function() print("Test 1") end)
-- conn(function() print("Test 2") end)
-- conn(function() print("Test 3") end)
-- conn(function() print("Test 4") end)
-- print("Fire 1")
-- conn:Fire()
-- conn = -conn
-- print("Fire 2")
-- conn:Fire()
-- print(#conn)
-- thread:newThread("Test thread", function()
-- print("Starting thread!")
-- thread.defer(function() -- Runs when the thread finishes execution
-- print("Clean up time!")
-- end)
-- --[[
-- Do lot's of stuff
-- ]]
-- thread.sleep(3)
-- end)
multi:mainloop()
-- local conn1, conn2, conn3 = multi:newConnection(nil,nil,true), multi:newConnection(), multi:newConnection()
-- local link = conn1(function()
-- print("Conn1, first")
-- end)
-- local link2 = conn1(function()
-- print("Conn1, second")
-- end)
-- local link3 = conn1(function()
-- print("Conn1, third")
-- end)
-- local link4 = conn2(function()
-- print("Conn2, first")
-- end)
-- local link5 = conn2(function()
-- print("Conn2, second")
-- end)
-- local link6 = conn2(function()
-- print("Conn2, third")
-- end)
-- print("Links 1-6",link,link2,link3,link4,link5,link6)
-- conn1:Lock(link)
-- print("All conns\n-------------")
-- conn1:Fire()
-- conn2:Fire()
-- conn1:Unlock(link)
-- conn1:Unconnect(link3)
-- conn2:Unconnect(link6)
-- print("All conns Edit\n---------------------")
-- conn1:Fire()
-- conn2:Fire()
-- thread:newThread(function()
-- print("Awaiting status")
-- thread.hold(conn1 + (conn2 * conn3))
-- print("Conn or Conn2 and Conn3")
-- end)
-- multi:newAlarm(1):OnRing(function()
-- print("Conn")
-- conn1:Fire()
-- end)
-- multi:newAlarm(2):OnRing(function()
-- print("Conn2")
-- conn2:Fire()
-- end)
-- multi:newAlarm(3):OnRing(function()
-- print("Conn3")
-- conn3:Fire()
-- os.exit()
-- end)
-- local conn = multi:newSystemThreadedConnection("conn"):init()
-- multi:newSystemThread("Thread_Test_1", function()
-- local multi, thread = require("multi"):init()
-- local conn = GLOBAL["conn"]:init()
-- local console = THREAD.getConsole()
-- conn(function(a,b,c)
-- console.print(THREAD:getName().." was triggered!",a,b,c)
-- end)
-- multi:mainloop()
-- end)
-- multi:newSystemThread("Thread_Test_2", function()
-- local multi, thread = require("multi"):init()
-- local conn = GLOBAL["conn"]:init()
-- local console = THREAD.getConsole()
-- conn(function(a,b,c)
-- console.print(THREAD:getName().." was triggered!",a,b,c)
-- end)
-- multi:newAlarm(2):OnRing(function()
-- console.print("Fire 2!!!")
-- conn:Fire(4,5,6)
-- THREAD.kill()
-- end)
-- multi:mainloop()
-- end)
-- local console = THREAD.getConsole()
-- conn(function(a,b,c)
-- console.print("Mainloop conn got triggered!",a,b,c)
-- end)
-- alarm = multi:newAlarm(1)
-- alarm:OnRing(function()
-- console.print("Fire 1!!!")
-- conn:Fire(1,2,3)
-- end)
-- alarm = multi:newAlarm(3):OnRing(function()
-- multi:newSystemThread("Thread_Test_3",function()
-- local multi, thread = require("multi"):init()
-- local conn = GLOBAL["conn"]:init()
-- local console = THREAD.getConsole()
-- conn(function(a,b,c)
-- console.print(THREAD:getName().." was triggered!",a,b,c)
-- end)
-- multi:newAlarm(4):OnRing(function()
-- console.print("Fire 3!!!")
-- conn:Fire(7,8,9)
-- end)
-- multi:mainloop()
-- end)
-- end)
-- multi:newSystemThread("Thread_Test_4",function()
-- local multi, thread = require("multi"):init()
-- local conn = GLOBAL["conn"]:init()
-- local conn2 = multi:newConnection()
-- local console = THREAD.getConsole()
-- multi:newAlarm(2):OnRing(function()
-- conn2:Fire()
-- end)
-- multi:newThread(function()
-- console.print("Conn Test!")
-- thread.hold(conn + conn2)
-- console.print("It held!")
-- end)
-- multi:mainloop()
-- end)
-- multi:mainloop()
--[[
newFunction function: 0x00fad170
waitFor function: 0x00fad0c8
request function: 0x00fa4f10
newThread function: 0x00fad1b8
--__threads table: 0x00fa4dc8
defer function: 0x00fa4f98
isThread function: 0x00facd40
holdFor function: 0x00fa5058
yield function: 0x00faccf8
hold function: 0x00fa51a0
chain function: 0x00fa5180
__CORES 32
newISOThread function: 0x00fad250
newFunctionBase function: 0x00fad128
requests table: 0x00fa4e68
newProcessor function: 0x00fad190
exec function: 0x00fa50e8
pushStatus function: 0x00fad108
kill function: 0x00faccd8
get function: 0x00fad0a8
set function: 0x00fad088
getCores function: 0x00facd60
skip function: 0x00faccb0
--_Requests function: 0x00fa50a0
getRunningThread function: 0x00fa4fb8
holdWithin function: 0x00facc80
sleep function: 0x00fa4df0
]]
+1 -1
View File
@@ -1,4 +1,4 @@
package.path = "../?/init.lua;../?.lua;../init.lua;../?.lua;" .. package.path
package.path = "D:/VSCWorkspace/?/init.lua;D:/VSCWorkspace/?.lua;"..package.path
package.cpath = "C:/luaInstalls/lua5.4/lib/lua/5.4/?/core.dll;" .. package.cpath
multi, thread = require("multi"):init{error=true,warning=true,print=true, priority=true}
proc = multi:newProcessor("Thread Test",true)
File diff suppressed because it is too large Load Diff