updated some files

This commit is contained in:
Ryan Ward 2018-09-17 11:37:17 -04:00
parent 29cc0b8935
commit d1f8bc9492
4 changed files with 68 additions and 35 deletions

View File

@ -1,6 +0,0 @@
<details>
<summary>Example Code</summary>
```lua
-- wonder if this works. if it does then awesome
```
</details>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
# multi Version: 12.2.0 Added better priority management, function chaining, and some bug fixes
# multi Version: 12.2.1 Some bug fixes
My multitasking library for lua. It is a pure lua binding, if you ignore the integrations and the love2d compat. If you find any bugs or have any issues, please let me know . **If you don't see a table of contents try using the ReadMe.html file. It is easier to navigate than readme**</br>

View File

@ -12,192 +12,231 @@
<h1 id="changes"><a name="changes" href="#changes"></a>Changes</h1><p class="toc" style="undefined"></p><ul>
<li><ul>
<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 class="number">
0
</span-->
</li>
<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 class="number">
1
</span-->
</li>
<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 class="number">
2
</span-->
</li>
<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 class="number">
3
</span-->
</li>
<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 class="number">
4
</span-->
</li>
<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 class="number">
5
</span-->
</li>
<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 class="number">
6
</span-->
</li>
<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 class="number">
7
</span-->
</li>
<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 class="number">
8
</span-->
</li>
<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 class="number">
9
</span-->
</li>
<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 class="number">
10
</span-->
</li>
<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 class="number">
11
</span-->
</li>
<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 class="number">
12
</span-->
</li>
<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 class="number">
13
</span-->
</li>
<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 class="number">
14
</span-->
</li>
<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 class="number">
15
</span-->
</li>
<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 class="number">
16
</span-->
</li>
<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 class="number">
17
</span-->
</li>
<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 class="number">
18
</span-->
</li>
<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 class="number">
19
</span-->
</li>
<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 class="number">
20
</span-->
</li>
<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 class="number">
21
</span-->
</li>
<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 class="number">
22
</span-->
</li>
<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 class="number">
23
</span-->
</li>
<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 class="number">
24
</span-->
</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>
<a href="#update:-1.5.0" title="Update: 1.5.0">Update: 1.5.0</a>
</span>
<!--span class="number">
25
</span-->
</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">
26
</span-->
</li>
</ul>
</li>
</ul>
<p></p><h2 id="update-12.2.0"><a name="update-12.2.0" href="#update-12.2.0"></a>Update 12.2.0</h2><p><strong>Added:</strong></p><ul>
<p></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>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>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;)
GLOBAL, THREAD = require(&quot;multi.integration.lanesManager&quot;).init()
jq = multi:newSystemThreadedJobQueue()
jq:registerJob(&quot;test&quot;,function(a)
return &quot;Hello&quot;,a
end)
jq.OnJobCompleted(function(ID,...)
print(ID,...)
end)
for i=1,16 do
jq:pushJob(&quot;test&quot;,5)
end
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
multi = <span class="hljs-built_in">require</span>(<span class="hljs-string">"multi"</span>)
GLOBAL, THREAD = <span class="hljs-built_in">require</span>(<span class="hljs-string">"multi.integration.lanesManager"</span>).init()
jq = multi:newSystemThreadedJobQueue()
jq:registerJob(<span class="hljs-string">"test"</span>,<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(a)</span></span>
<span class="hljs-keyword">return</span> <span class="hljs-string">"Hello"</span>,a
<span class="hljs-keyword">end</span>)
jq.OnJobCompleted(<span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">(ID,...)</span></span>
<span class="hljs-built_in">print</span>(ID,...)
<span class="hljs-keyword">end</span>)
<span class="hljs-keyword">for</span> i=<span class="hljs-number">1</span>,<span class="hljs-number">16</span> <span class="hljs-keyword">do</span>
jq:pushJob(<span class="hljs-string">"test"</span>,<span class="hljs-number">5</span>)
<span class="hljs-keyword">end</span>
multi:mainloop()
</code></pre><h2 id="update-12.2.0"><a name="update-12.2.0" href="#update-12.2.0"></a>Update 12.2.0</h2><p><strong>Added:</strong></p><ul>
<li>multi.nextStep(func)</li><li>Method chaining</li><li>Priority 3 has been added!</li><li>ResetPriority() — This will set a flag for a process to be re evaluated for how much of an impact it is having on the performance of the system.</li><li>setting: auto_priority added! — If only lua os.clock was more fine tuned… milliseconds are not enough for this to work</li><li>setting: auto_lowerbound added! — when using auto_priority this will allow you to set the lowbound for pirority. The defualt is a hyrid value that was calculated to reach the max potential with a delay of .001, but can be changed to whatever. Remember this is set to processes that preform really badly! If lua could handle more detail in regards to os.clock() then i would set the value a bit lower like .0005 or something like that</li><li>setting: auto_stretch added! — This is another way to modify the extent of the lowest setting. This reduces the impact that a low preforming process has! Setting this higher reduces the number of times that a process is called. Only in effect when using auto_priotity</li><li>setting: auto_delay added! — sets the time in seconds that the system will recheck for low performing processes and manage them. Will also upgrade a process if it starts to run better.<pre class="lua hljs"><code class="lua" data-origin="<pre><code class=&quot;lua&quot;>-- All methods that did not return before now return a copy of itself. Thus allowing chaining. Most if not all mutators returned nil, so chaining can now be done. I will eventually write up a full documentation of everything which will show this.
multi = require(&quot;multi&quot;)
multi:newStep(1,100):OnStep(function(self,i)