13.0.0 Stability testing

To be released soon
This commit is contained in:
Ryan Ward 2019-03-22 21:20:30 -04:00
parent 2fad69a1ec
commit 6714878ae9
5 changed files with 1102 additions and 78 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ sample-node.lua
sample-master.lua sample-master.lua
Ayn Rand - The Virtue of Selfishness-Mg4QJheclsQ.m4a Ayn Rand - The Virtue of Selfishness-Mg4QJheclsQ.m4a
Atlas Shrugged by Ayn Rand Audiobook-9s2qrEau63E.webm Atlas Shrugged by Ayn Rand Audiobook-9s2qrEau63E.webm
test.lua
test.lua

File diff suppressed because one or more lines are too long

View File

@ -12,209 +12,315 @@
<h1 id="changes"><a name="changes" href="#changes"></a>Changes</h1><p class="toc" style="undefined"></p><ul> <h1 id="changes"><a name="changes" href="#changes"></a>Changes</h1><p class="toc" style="undefined"></p><ul>
<li><ul> <li><ul>
<li><span class="title"> <li><span class="title">
<a href="#update-12.2.2-time-for-some-more-bug-fixes!" title="Update 12.2.2 Time for some more bug fixes! ">Update 12.2.2 Time for some more bug fixes! </a> <a href="#update-13.0.0-added-some-documentation,-and-some-new-features-too-check-it-out!" title="Update 13.0.0 Added some documentation, and some new features too check it out!">Update 13.0.0 Added some documentation, and some new features too check it out!</a>
</span> </span>
<!--span class="number"> <!--span class="number">
0 0
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update-12.2.1-time-for-some-bug-fixes!" title="Update 12.2.1 Time for some bug fixes! ">Update 12.2.1 Time for some bug fixes! </a> <a href="#update-12.2.2-time-for-some-more-bug-fixes!" title="Update 12.2.2 Time for some more bug fixes!">Update 12.2.2 Time for some more bug fixes!</a>
</span> </span>
<!--span class="number"> <!--span class="number">
1 1
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update-12.2.0" title="Update 12.2.0">Update 12.2.0</a> <a href="#update-12.2.1-time-for-some-bug-fixes!" title="Update 12.2.1 Time for some bug fixes!">Update 12.2.1 Time for some bug fixes!</a>
</span> </span>
<!--span class="number"> <!--span class="number">
2 2
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update-12.1.0" title="Update 12.1.0">Update 12.1.0</a> <a href="#update-12.2.0" title="Update 12.2.0">Update 12.2.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
3 3
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-12.0.0-big-update-(lots-of-additions-some-changes)" title="Update: 12.0.0 Big update (Lots of additions some changes)">Update: 12.0.0 Big update (Lots of additions some changes)</a> <a href="#update-12.1.0" title="Update 12.1.0">Update 12.1.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
4 4
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.11.1" title="Update: 1.11.1">Update: 1.11.1</a> <a href="#update:-12.0.0-big-update-(lots-of-additions-some-changes)" title="Update: 12.0.0 Big update (Lots of additions some changes)">Update: 12.0.0 Big update (Lots of additions some changes)</a>
</span> </span>
<!--span class="number"> <!--span class="number">
5 5
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.11.0" title="Update: 1.11.0">Update: 1.11.0</a> <a href="#update:-1.11.1" title="Update: 1.11.1">Update: 1.11.1</a>
</span> </span>
<!--span class="number"> <!--span class="number">
6 6
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.10.0" title="Update: 1.10.0">Update: 1.10.0</a> <a href="#update:-1.11.0" title="Update: 1.11.0">Update: 1.11.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
7 7
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.9.2" title="Update: 1.9.2">Update: 1.9.2</a> <a href="#update:-1.10.0" title="Update: 1.10.0">Update: 1.10.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
8 8
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.9.1" title="Update: 1.9.1">Update: 1.9.1</a> <a href="#update:-1.9.2" title="Update: 1.9.2">Update: 1.9.2</a>
</span> </span>
<!--span class="number"> <!--span class="number">
9 9
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.9.0" title="Update: 1.9.0">Update: 1.9.0</a> <a href="#update:-1.9.1" title="Update: 1.9.1">Update: 1.9.1</a>
</span> </span>
<!--span class="number"> <!--span class="number">
10 10
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.7" title="Update: 1.8.7">Update: 1.8.7</a> <a href="#update:-1.9.0" title="Update: 1.9.0">Update: 1.9.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
11 11
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.6" title="Update: 1.8.6">Update: 1.8.6</a> <a href="#update:-1.8.7" title="Update: 1.8.7">Update: 1.8.7</a>
</span> </span>
<!--span class="number"> <!--span class="number">
12 12
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.5" title="Update: 1.8.5">Update: 1.8.5</a> <a href="#update:-1.8.6" title="Update: 1.8.6">Update: 1.8.6</a>
</span> </span>
<!--span class="number"> <!--span class="number">
13 13
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.4" title="Update: 1.8.4">Update: 1.8.4</a> <a href="#update:-1.8.5" title="Update: 1.8.5">Update: 1.8.5</a>
</span> </span>
<!--span class="number"> <!--span class="number">
14 14
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.3" title="Update: 1.8.3">Update: 1.8.3</a> <a href="#update:-1.8.4" title="Update: 1.8.4">Update: 1.8.4</a>
</span> </span>
<!--span class="number"> <!--span class="number">
15 15
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.2" title="Update: 1.8.2">Update: 1.8.2</a> <a href="#update:-1.8.3" title="Update: 1.8.3">Update: 1.8.3</a>
</span> </span>
<!--span class="number"> <!--span class="number">
16 16
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.8.1" title="Update: 1.8.1">Update: 1.8.1</a> <a href="#update:-1.8.2" title="Update: 1.8.2">Update: 1.8.2</a>
</span> </span>
<!--span class="number"> <!--span class="number">
17 17
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.6" title="Update: 1.7.6">Update: 1.7.6</a> <a href="#update:-1.8.1" title="Update: 1.8.1">Update: 1.8.1</a>
</span> </span>
<!--span class="number"> <!--span class="number">
18 18
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.5" title="Update: 1.7.5">Update: 1.7.5</a> <a href="#update:-1.7.6" title="Update: 1.7.6">Update: 1.7.6</a>
</span> </span>
<!--span class="number"> <!--span class="number">
19 19
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.4" title="Update: 1.7.4">Update: 1.7.4</a> <a href="#update:-1.7.5" title="Update: 1.7.5">Update: 1.7.5</a>
</span> </span>
<!--span class="number"> <!--span class="number">
20 20
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.3" title="Update: 1.7.3">Update: 1.7.3</a> <a href="#update:-1.7.4" title="Update: 1.7.4">Update: 1.7.4</a>
</span> </span>
<!--span class="number"> <!--span class="number">
21 21
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.2" title="Update: 1.7.2">Update: 1.7.2</a> <a href="#update:-1.7.3" title="Update: 1.7.3">Update: 1.7.3</a>
</span> </span>
<!--span class="number"> <!--span class="number">
22 22
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.1-bug-fixes-only" title="Update: 1.7.1 Bug Fixes Only">Update: 1.7.1 Bug Fixes Only</a> <a href="#update:-1.7.2" title="Update: 1.7.2">Update: 1.7.2</a>
</span> </span>
<!--span class="number"> <!--span class="number">
23 23
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.7.0" title="Update: 1.7.0">Update: 1.7.0</a> <a href="#update:-1.7.1-bug-fixes-only" title="Update: 1.7.1 Bug Fixes Only">Update: 1.7.1 Bug Fixes Only</a>
</span> </span>
<!--span class="number"> <!--span class="number">
24 24
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.6.0" title="Update: 1.6.0">Update: 1.6.0</a> <a href="#update:-1.7.0" title="Update: 1.7.0">Update: 1.7.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
25 25
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.5.0" title="Update: 1.5.0">Update: 1.5.0</a> <a href="#update:-1.6.0" title="Update: 1.6.0">Update: 1.6.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
26 26
</span--> </span-->
</li> </li>
<li><span class="title"> <li><span class="title">
<a href="#update:-1.4.1---first-public-release-of-the-library" title="Update: 1.4.1 - First Public release of the library">Update: 1.4.1 - First Public release of the library</a> <a href="#update:-1.5.0" title="Update: 1.5.0">Update: 1.5.0</a>
</span> </span>
<!--span class="number"> <!--span class="number">
27 27
</span--> </span-->
</li> </li>
<li><span class="title">
<a href="#update:-1.4.1---first-public-release-of-the-library" title="Update: 1.4.1 - First Public release of the library">Update: 1.4.1 - First Public release of the library</a>
</span>
<!--span class="number">
28
</span-->
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
<p></p><h2 id="update-12.2.2-time-for-some-more-bug-fixes!"><a name="update-12.2.2-time-for-some-more-bug-fixes!" href="#update-12.2.2-time-for-some-more-bug-fixes!"></a>Update 12.2.2 Time for some more bug fixes! </h2><p>Fixed: multi.Stop() not actually stopping due to the new pirority management scheme and preformance boost changes.<br>Thats all for this update</p><h2 id="update-12.2.1-time-for-some-bug-fixes!"><a name="update-12.2.1-time-for-some-bug-fixes!" href="#update-12.2.1-time-for-some-bug-fixes!"></a>Update 12.2.1 Time for some bug fixes! </h2><p>Fixed: SystemThreadedJobQueues</p><ul> <p></p><h2 id="update-13.0.0-added-some-documentation,-and-some-new-features-too-check-it-out!"><a name="update-13.0.0-added-some-documentation,-and-some-new-features-too-check-it-out!" href="#update-13.0.0-added-some-documentation,-and-some-new-features-too-check-it-out!"></a>Update 13.0.0 Added some documentation, and some new features too check it out!</h2><p><strong>Quick note</strong> on the 13.0.0 update:<br>This update I went all in finding bugs and improving proformance within the library. I added some new features and the new task manager, which I used as a way to debug the library was a great help, so much so thats it is now a permanent feature. Its been about half a year since my last update, but so much work needed to be done. I hope you can find a use in your code to use my library. I am extremely proud of my work; 7 years of development, I learned so much about lua and programming through the creation of this library. It was fun, but there will always be more to add and bugs crawling there way in. I cant wait to see where this library goes in the future!</p><p>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.<br>Changed: </p><ul>
<li>A few things, to make concepts in the library more clear.</li><li>The way functions returned paused status. Before it would return “PAUSED” now it returns nil, true if paused</li><li>Modified the connection object to allow for some more syntaxial suger!</li><li>System threads now trigger an OnError connection that is a member of the object itself. multi.OnError() is no longer triggered for a system thread that crashes!</li></ul><p>Connection Example:</p><pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>loop = multi:newTLoop(function(self)
self:OnLoops() -- new way to Fire a connection! Only works when used on a multi object, bin objects, or any object that contains a Type variable
end,1)
loop.OnLoops = multi:newConnection()
loop.OnLoops(function()
print(&quot;Looping&quot;)
end)
multi:mainloop()
</code></pre>">loop = multi:newTLoop(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(self)</span></span>
self:OnLoops() <span class="hljs-comment">-- new way to Fire a connection! Only works when used on a multi object, bin objects, or any object that contains a Type variable</span>
<span class="hljs-keyword">end</span>,<span class="hljs-number">1</span>)
loop.OnLoops = multi:newConnection()
loop.OnLoops(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span></span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">"Looping"</span>)
<span class="hljs-keyword">end</span>)
multi:mainloop()
</code></pre><p>Function Example:</p><pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>func = multi:newFunction(function(self,a,b)
self:Pause()
return 1,2,3
end)
print(func()) -- returns: 1, 2, 3
print(func()) -- nil, true
</code></pre>">func = multi:newFunction(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(self,a,b)</span></span>
self:Pause()
<span class="hljs-keyword">return</span> <span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>
<span class="hljs-keyword">end</span>)
<span class="hljs-built_in">print</span>(func()) <span class="hljs-comment">-- returns: 1, 2, 3</span>
<span class="hljs-built_in">print</span>(func()) <span class="hljs-comment">-- nil, true</span>
</code></pre><p>Removed:</p><ul>
<li>Ranges and conditions — corutine based threads can emulate what these objects did and much better!</li><li>Due to the creation of hyper threaded processes the following objects are no more!<br><del>multi:newThreadedEvent()</del><br><del>multi:newThreadedLoop()</del><br><del>multi:newThreadedTLoop()</del><br><del>multi:newThreadedStep()</del><br><del>multi:newThreadedTStep()</del><br><del>multi:newThreadedAlarm()</del><br><del>multi:newThreadedUpdater()</del><br><del>multi:newTBase()</del> — Acted as the base for creating the other objects</li></ul><p>These didnt have much use in their previous form, but with the addition of hyper threaded processes the goals that these objects aimed to solve are now possible using a process</p><p>Fixed:</p><ul>
<li>There were some bugs in the networkmanager.lua file. Desrtoy -&gt; Destroy some misspellings.</li><li>Massive object management bugs which caused performance to drop like a rock.</li><li>Found a bug with processors not having the Destroy() function implemented properly.</li><li>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</li><li>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 (Im releasing 13.0.0 though this hasnt been ironed out just yet)</li><li>Fixed an issue where any argument greater than 256^2 or 65536 bytes is sent the networkmanager would soft crash. This was fixed by increading the limit to 256^4 or 4294967296. 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!?</li><li>Fixed an issue with processors not properly destroying objects within them and not being destroyable themselves</li><li>Fixed a bug where pause and resume would duplicate objects! Not good</li><li>Noticed that the switching of lua states, corutine based threading, is slower than multi-objs (Not by much though).</li><li>multi:newSystemThreadedConnection(name,protect) — I did it! It works and I believe all the gotchas are fixed as well.<br>— Issue one, if a thread died that was connected to that connection all connections would stop since the queue would get clogged! FIXED<br>— There is one thing, the connection does have some handshakes that need to be done before it functions as normal!</li></ul><p>Added:</p><ul>
<li>Documentation, the purpose of 13.0.0, orginally going to be 12.2.3, but due to the amount of bugs and features added it couldnt be a simple bug fix update.</li><li>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. Though, creating a self contained single thread is a better idea which when I eventually create the wiki page Ill discuss</li><li>multi:newConnector() — A simple object that allows you to use the new connection Fire syntax without using a multi obj or the standard object format that I follow.</li><li>multi:purge() — Removes all references to objects that are contained withing the processes list of tasks to do. Doing this will stop all objects from functioning. Calling Resume on an object should make it work again.</li><li>multi:getTasksDetails(STRING format) — Simple function, will get massive updates in the future, as of right now It will print out the current processes that are running; listing their type, uptime, and priority. More useful additions will be added in due time. Format can be either a string “s” or “t” see below for the table format</li><li>multi:endTask(TID) — Use multi:getTasksDetails(“t”) to get the tid of a task</li><li>multi:enableLoadDetection() — Reworked how load detection works. It gives better values now, but it still needs some work before I am happy with it</li><li>THREAD.getID() — returns a unique ID for the current thread. This varaiable is visible to the main thread as well by accessing it through the returned thread object. OBJ.Id Do not confuse this with thread.* this refers to the system threading interface. Each thread, including the main thread has a threadID the main thread has an ID of 0!</li><li>multi.print(…) works like normal print, but only prints if the setting print is set to true</li><li>setting: <code>print</code> enables multi.print() to work</li><li>STC: IgnoreSelf defaults to false, if true a Fire command will not be sent to the self</li><li>STC: OnConnectionAdded(function(connID)) — Is fired when a connection is added you can use STC:FireTo(id,…) to trigger a specific connection. Works like the named non threaded connections, only the ids are genereated for you.</li><li>STC: FireTo(id,…) — Described above.</li></ul><pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>package.path=&quot;?/init.lua;?.lua;&quot;..package.path
local multi = require(&quot;multi&quot;)
conn = multi:newConnector()
conn.OnTest = multi:newConnection()
conn.OnTest(function()
print(&quot;Yes!&quot;)
end)
test = multi:newHyperThreadedProcess(&quot;test&quot;)
test:newTLoop(function()
print(&quot;HI!&quot;)
conn:OnTest()
end,1)
test:newLoop(function()
print(&quot;HEY!&quot;)
thread.sleep(.5)
end)
multi:newAlarm(3):OnRing(function()
test:Sleep(10)
end)
test:Start()
multi:mainloop()
</code></pre>"><span class="hljs-built_in">package</span>.path=<span class="hljs-string">"?/init.lua;?.lua;"</span>..<span class="hljs-built_in">package</span>.path
<span class="hljs-keyword">local</span> multi = <span class="hljs-built_in">require</span>(<span class="hljs-string">"multi"</span>)
conn = multi:newConnector()
conn.OnTest = multi:newConnection()
conn.OnTest(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span></span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">"Yes!"</span>)
<span class="hljs-keyword">end</span>)
test = multi:newHyperThreadedProcess(<span class="hljs-string">"test"</span>)
test:newTLoop(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span></span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">"HI!"</span>)
conn:OnTest()
<span class="hljs-keyword">end</span>,<span class="hljs-number">1</span>)
test:newLoop(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span></span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">"HEY!"</span>)
thread.sleep(.<span class="hljs-number">5</span>)
<span class="hljs-keyword">end</span>)
multi:newAlarm(<span class="hljs-number">3</span>):OnRing(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span></span>
test:Sleep(<span class="hljs-number">10</span>)
<span class="hljs-keyword">end</span>)
test:Start()
multi:mainloop()
</code></pre><p>Table format for getTasksDetails(STRING format)</p><pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>{
{TID = 1,Type=&quot;&quot;,Priority=&quot;&quot;,Uptime=0}
{TID = 2,Type=&quot;&quot;,Priority=&quot;&quot;,Uptime=0}
...
{TID = n,Type=&quot;&quot;,Priority=&quot;&quot;,Uptime=0}
ThreadCount = 0
threads={
[Thread_Name]={
Uptime = 0
}
}
}
</code></pre>">{
{TID = <span class="hljs-number">1</span>,Type=<span class="hljs-string">""</span>,Priority=<span class="hljs-string">""</span>,Uptime=<span class="hljs-number">0</span>}
{TID = <span class="hljs-number">2</span>,Type=<span class="hljs-string">""</span>,Priority=<span class="hljs-string">""</span>,Uptime=<span class="hljs-number">0</span>}
...
{TID = n,Type=<span class="hljs-string">""</span>,Priority=<span class="hljs-string">""</span>,Uptime=<span class="hljs-number">0</span>}
ThreadCount = <span class="hljs-number">0</span>
threads={
[Thread_Name]={
Uptime = <span class="hljs-number">0</span>
}
}
}
</code></pre><p><strong>Note:</strong> After adding the getTasksDetails() function I noticed many areas where threads, and tasks were not being cleaned up and fixed the leaks. I also found out that a lot of tasks were starting by default and made them enable only. If you compare the benchmark from this version to last version you;ll notice a signifacant increase in performance.</p><p><strong>Going forward:</strong></p><ul>
<li>Work on system threaded functions</li><li>work on the node manager</li><li>patch up bugs</li><li>finish documentstion</li></ul><h2 id="update-12.2.2-time-for-some-more-bug-fixes!"><a name="update-12.2.2-time-for-some-more-bug-fixes!" href="#update-12.2.2-time-for-some-more-bug-fixes!"></a>Update 12.2.2 Time for some more bug fixes!</h2><p>Fixed: multi.Stop() not actually stopping due to the new pirority management scheme and preformance boost changes.<br>Thats all for this update</p><h2 id="update-12.2.1-time-for-some-bug-fixes!"><a name="update-12.2.1-time-for-some-bug-fixes!" href="#update-12.2.1-time-for-some-bug-fixes!"></a>Update 12.2.1 Time for some bug fixes!</h2><p>Fixed: SystemThreadedJobQueues</p><ul>
<li>You can now make as many job queues as you want! Just a warning when using a large amount of cores for the queue it takes a second or 2 to set up the jobqueues for data transfer. I am unsure if this is a lanes thing or not, but love2d has no such delay when setting up the jobqueue!</li><li>You now connect to the OnReady in the jobqueue object. No more holding everything else as you wait for a job queue to be ready</li><li>Jobqueues:doToAll now passes the queues multi interface as the first and currently only argument</li><li>No longer need to use jobqueue.OnReady() The code is smarter and will send the pushed jobs automatically when the threads are ready</li></ul><p>Fixed: SystemThreadedConnection</p><ul> <li>You can now make as many job queues as you want! Just a warning when using a large amount of cores for the queue it takes a second or 2 to set up the jobqueues for data transfer. I am unsure if this is a lanes thing or not, but love2d has no such delay when setting up the jobqueue!</li><li>You now connect to the OnReady in the jobqueue object. No more holding everything else as you wait for a job queue to be ready</li><li>Jobqueues:doToAll now passes the queues multi interface as the first and currently only argument</li><li>No longer need to use jobqueue.OnReady() The code is smarter and will send the pushed jobs automatically when the threads are ready</li></ul><p>Fixed: SystemThreadedConnection</p><ul>
<li>They work the exact same way as before, but actually work as expected now. The issue before was how i implemented it. Now each connection knows the number of instances of that object that ecist. This way I no longer have to do fancy timings that may or may not work. I can send exactly enough info for each connection to consume from the queue.</li></ul><p>Removed: multi:newQueuer</p><ul> <li>They work the exact same way as before, but actually work as expected now. The issue before was how i implemented it. Now each connection knows the number of instances of that object that ecist. This way I no longer have to do fancy timings that may or may not work. I can send exactly enough info for each connection to consume from the queue.</li></ul><p>Removed: multi:newQueuer</p><ul>
<li>This feature has no real use after corutine based threads were introduced. You can use those to get the same effect as the queuer and do it better too. </li></ul><p>Going forward:</p><ul> <li>This feature has no real use after corutine based threads were introduced. You can use those to get the same effect as the queuer and do it better too. </li></ul><p>Going forwardGoing forward:</p><ul>
<li>Will I ever finish steralization? Who knows, but being able to save state would be nice. The main issue is there is no simple way to save state. While I can provide methods to allow one to turn the objects into strings and back, there is no way for me to make your code work with it in a simple way. For now only the basic functions will be here.</li><li>I need to make better documentation for this library as well. In its current state, all I have are examples and not a list of what is what.</li></ul><h1 id="example"><a name="example" href="#example"></a>Example</h1><pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>package.path=&quot;?/init.lua;?.lua;&quot;..package.path <li>Will I ever finish steralization? Who knows, but being able to save state would be nice. The main issue is there is no simple way to save state. While I can provide methods to allow one to turn the objects into strings and back, there is no way for me to make your code work with it in a simple way. For now only the basic functions will be here.</li><li>I need to make better documentation for this library as well. In its current state, all I have are examples and not a list of what is what.</li></ul><h1 id="example"><a name="example" href="#example"></a>Example</h1><pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>package.path=&quot;?/init.lua;?.lua;&quot;..package.path
multi = require(&quot;multi&quot;) multi = require(&quot;multi&quot;)
GLOBAL, THREAD = require(&quot;multi.integration.lanesManager&quot;).init() GLOBAL, THREAD = require(&quot;multi.integration.lanesManager&quot;).init()

View File

@ -1,6 +1,6 @@
#Changes #Changes
[TOC] [TOC]
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. Update 13.0.0 Added some documentation, and some new features too check it out!
------------- -------------
**Quick note** on the 13.0.0 update: **Quick note** on the 13.0.0 update:
This update I went all in finding bugs and improving proformance within the library. I added some new features and the new task manager, which I used as a way to debug the library was a great help, so much so thats it is now a permanent feature. It's been about half a year since my last update, but so much work needed to be done. I hope you can find a use in your code to use my library. I am extremely proud of my work; 7 years of development, I learned so much about lua and programming through the creation of this library. It was fun, but there will always be more to add and bugs crawling there way in. I can't wait to see where this library goes in the future! This update I went all in finding bugs and improving proformance within the library. I added some new features and the new task manager, which I used as a way to debug the library was a great help, so much so thats it is now a permanent feature. It's been about half a year since my last update, but so much work needed to be done. I hope you can find a use in your code to use my library. I am extremely proud of my work; 7 years of development, I learned so much about lua and programming through the creation of this library. It was fun, but there will always be more to add and bugs crawling there way in. I can't wait to see where this library goes in the future!
@ -15,7 +15,7 @@ Changed:
Connection Example: Connection Example:
```lua ```lua
loop = multi:newTLoop(function(self) loop = multi:newTLoop(function(self)
self:OnLoops() -- new way to Fire a connection! Only works when used on a multi object, bin objects, or any object that contains a Type parameter self:OnLoops() -- new way to Fire a connection! Only works when used on a multi object, bin objects, or any object that contains a Type variable
end,1) end,1)
loop.OnLoops = multi:newConnection() loop.OnLoops = multi:newConnection()
loop.OnLoops(function() loop.OnLoops(function()
@ -53,11 +53,11 @@ Fixed:
- Massive object management bugs which caused performance to drop like a rock. - Massive object management bugs which caused performance to drop like a rock.
- Found a bug with processors not having the Destroy() function implemented properly. - 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 - 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 - 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 (Im releasing 13.0.0 though this hasn't been ironed out just yet)
- 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!? - Fixed an issue where any argument greater than 256^2 or 65536 bytes is sent the networkmanager would soft crash. This was fixed by increading the limit to 256^4 or 4294967296. 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!?
- Fixed an issue with processors not properly destroying objects within them and not being destroyable themselves - Fixed an issue with processors not properly destroying objects within them and not being destroyable themselves
- Fixed a bug where pause and resume would duplicate objects! Not good - Fixed a bug where pause and resume would duplicate objects! Not good
- Noticed that the switching of lua states, corutine based threading, is slow when done often. Code your threads to have an idler of .5 seconds between sleep states. After doing this to a few built in threads I've seen a nice drop in performance. 68%-100% to 0%-40% when using the jobqueue. If you dont need the hold feature then use a multi object! Sleeping can be done in a multi object using timers and alarms. Though if your aim is speed timers are a bit faster than alarms, if you really want to boost speed then local clock = os.clock and use the clock function to do your timings yourself - Noticed that the switching of lua states, corutine based threading, is slower than multi-objs (Not by much though).
- multi:newSystemThreadedConnection(name,protect) -- I did it! It works and I believe all the gotchas are fixed as well. - multi:newSystemThreadedConnection(name,protect) -- I did it! It works and I believe all the gotchas are fixed as well.
-- Issue one, if a thread died that was connected to that connection all connections would stop since the queue would get clogged! FIXED -- Issue one, if a thread died that was connected to that connection all connections would stop since the queue would get clogged! FIXED
-- There is one thing, the connection does have some handshakes that need to be done before it functions as normal! -- There is one thing, the connection does have some handshakes that need to be done before it functions as normal!
@ -118,7 +118,10 @@ Table format for getTasksDetails(STRING format)
**Note:** After adding the getTasksDetails() function I noticed many areas where threads, and tasks were not being cleaned up and fixed the leaks. I also found out that a lot of tasks were starting by default and made them enable only. If you compare the benchmark from this version to last version you;ll notice a signifacant increase in performance. **Note:** After adding the getTasksDetails() function I noticed many areas where threads, and tasks were not being cleaned up and fixed the leaks. I also found out that a lot of tasks were starting by default and made them enable only. If you compare the benchmark from this version to last version you;ll notice a signifacant increase in performance.
**Going forward:** **Going forward:**
- Add something - Work on system threaded functions
- work on the node manager
- patch up bugs
- finish documentstion
Update 12.2.2 Time for some more bug fixes! Update 12.2.2 Time for some more bug fixes!
------------- -------------
@ -139,7 +142,7 @@ Fixed: SystemThreadedConnection
Removed: multi:newQueuer Removed: multi:newQueuer
- This feature has no real use after corutine based threads were introduced. You can use those to get the same effect as the queuer and do it better too. - This feature has no real use after corutine based threads were introduced. You can use those to get the same effect as the queuer and do it better too.
Going forward: Going forwardGoing forward:
- Will I ever finish steralization? Who knows, but being able to save state would be nice. The main issue is there is no simple way to save state. While I can provide methods to allow one to turn the objects into strings and back, there is no way for me to make your code work with it in a simple way. For now only the basic functions will be here. - Will I ever finish steralization? Who knows, but being able to save state would be nice. The main issue is there is no simple way to save state. While I can provide methods to allow one to turn the objects into strings and back, there is no way for me to make your code work with it in a simple way. For now only the basic functions will be here.
- I need to make better documentation for this library as well. In its current state, all I have are examples and not a list of what is what. - I need to make better documentation for this library as well. In its current state, all I have are examples and not a list of what is what.

View File

@ -2,36 +2,36 @@ package.path="?/init.lua;?.lua;"..package.path
multi = require("multi") multi = require("multi")
local GLOBAL,THREAD = require("multi.integration.lanesManager").init() local GLOBAL,THREAD = require("multi.integration.lanesManager").init()
nGLOBAL = require("multi.integration.networkManager").init() nGLOBAL = require("multi.integration.networkManager").init()
local a --~ local a
local clock = os.clock --~ local clock = os.clock
function sleep(n) -- seconds --~ function sleep(n) -- seconds
local t0 = clock() --~ local t0 = clock()
while clock() - t0 <= n do end --~ while clock() - t0 <= n do end
end --~ end
master = multi:newMaster{ --~ master = multi:newMaster{
name = "Main", -- the name of the master --~ name = "Main", -- the name of the master
noBroadCast = true, -- if using the node manager, set this to true to avoid double connections --~ noBroadCast = true, -- if using the node manager, set this to true to avoid double connections
managerDetails = {"localhost",12345}, -- the details to connect to the node manager (ip,port) --~ managerDetails = {"localhost",12345}, -- the details to connect to the node manager (ip,port)
} --~ }
master.OnError(function(name,err) --~ master.OnError(function(name,err)
print(name.." has encountered an error: "..err) --~ print(name.." has encountered an error: "..err)
end) --~ end)
local connlist = {} --~ local connlist = {}
multi:newThread("NodeUpdater",function() --~ multi:newThread("NodeUpdater",function()
while true do --~ while true do
thread.sleep(1) --~ thread.sleep(1)
for i=1,#connlist do --~ for i=1,#connlist do
master:execute("TASK_MAN",connlist[i], multi:getTasksDetails()) --~ master:execute("TASK_MAN",connlist[i], multi:getTasksDetails())
end --~ end
end --~ end
end) --~ end)
master.OnNodeConnected(function(name) --~ master.OnNodeConnected(function(name)
print("Connected to the node") --~ print("Connected to the node")
table.insert(connlist,name) --~ table.insert(connlist,name)
end) --~ end)
multi.OnError(function(...) --~ multi.OnError(function(...)
print(...) --~ print(...)
end) --~ end)
multi:mainloop{ multi:mainloop{
protect = false, protect = false,
print = true print = true