aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2012-09-10 20:41:03 +0200
committerBenoit Germain <bnt.germain@gmail.com>2012-09-10 20:41:03 +0200
commit242feeb342f68999b02c2b8dc4614abefdab8431 (patch)
tree904a3898035f89e5656036a0e7d454f560eb0455 /docs
parente37191ab11102ee784dc88578165074d2d0a2fff (diff)
downloadlanes-242feeb342f68999b02c2b8dc4614abefdab8431.tar.gz
lanes-242feeb342f68999b02c2b8dc4614abefdab8431.tar.bz2
lanes-242feeb342f68999b02c2b8dc4614abefdab8431.zip
version 3.3.0
* lane.status can return "killed" if lane was forcefully killed with lanes:cancel() * lane:join(): return nil, "killed" if called on a killed lane. * lane[<n>]: produces [1] = nil, [2] = "killed" if the lane was killed * lane:join(): fixed an assertion in debug builds when joining a lane forcefully cancelled with lane:cancel( <x>, true). * indexing a lane with a string other than "join", "cancel" or "status" raises an error. * fixed configure() to correctly apply defaults when they are missing from the provided settings * added a shutdown_timeout to control the duration Lanes will wait for graceful termination of running lanes at application shutdown. Default is 0.25. Among other things, fixes issue #31.
Diffstat (limited to 'docs')
-rw-r--r--docs/index.html33
1 files changed, 22 insertions, 11 deletions
diff --git a/docs/index.html b/docs/index.html
index 84ae5c0..932a712 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -56,7 +56,7 @@
56 56
57<p><br/><font size="-1"><i>Copyright &copy; 2007-12 Asko Kauppi, Benoit Germain. All rights reserved.</i> 57<p><br/><font size="-1"><i>Copyright &copy; 2007-12 Asko Kauppi, Benoit Germain. All rights reserved.</i>
58 <br>Lua Lanes is published under the same <A HREF="http://en.wikipedia.org/wiki/MIT_License">MIT license</A> as Lua 5.1 and 5.2. 58 <br>Lua Lanes is published under the same <A HREF="http://en.wikipedia.org/wiki/MIT_License">MIT license</A> as Lua 5.1 and 5.2.
59 </p><p>This document was revised on 21-Aug-12, and applies to version 3.2.0 59 </p><p>This document was revised on 10-Sep-12, and applies to version 3.3.0
60</font></p> 60</font></p>
61 61
62</center> 62</center>
@@ -205,7 +205,7 @@ Or use <A HREF="http://www.luarocks.org" TARGET="_blank">Lua Rocks</A> package m
205 <tr valign=top><td width=40></td><td> 205 <tr valign=top><td width=40></td><td>
206 <code>.nb_keepers</code> <br/><nobr>N</nobr></td><td width=40></td> 206 <code>.nb_keepers</code> <br/><nobr>N</nobr></td><td width=40></td>
207 <td> 207 <td>
208 Controls the number of keeper states used internally by lindas to transfer data between lanes. (see below). Default is 1. 208 Controls the number of keeper states used internally by lindas to transfer data between lanes. (see below). Default is <tt>1</tt>.
209 </td></tr> 209 </td></tr>
210 210
211 <tr valign=top><td/><td> 211 <tr valign=top><td/><td>
@@ -213,7 +213,7 @@ Or use <A HREF="http://www.luarocks.org" TARGET="_blank">Lua Rocks</A> package m
213 <td> 213 <td>
214 If equal to <tt>false</tt>, Lanes doesn't start the timer service, 214 If equal to <tt>false</tt>, Lanes doesn't start the timer service,
215 and the associated API will be absent from the interface (see below). 215 and the associated API will be absent from the interface (see below).
216 Any other value (including <tt>nil</tt>), starts the timer service. 216 Any other value (including <tt>nil</tt>), starts the timer service. Default is <tt>true</tt>.
217 </td></tr> 217 </td></tr>
218 218
219 <tr valign="top"> 219 <tr valign="top">
@@ -223,9 +223,15 @@ Or use <A HREF="http://www.luarocks.org" TARGET="_blank">Lua Rocks</A> package m
223 </td><td/> 223 </td><td/>
224 <td> 224 <td>
225 If provided, will be called in every created Lua state (keepers and lanes) right after it is created, and *before* any library is loaded. 225 If provided, will be called in every created Lua state (keepers and lanes) right after it is created, and *before* any library is loaded.
226 That way, all C functions it loads in the state can be added to the function lookup database. 226 That way, all C functions it loads in the state can be added to the function lookup database. Default is <tt>nil</tt>.
227 </td> 227 </td>
228 </tr> 228 </tr>
229
230 <tr valign=top><td width=40></td><td>
231 <code>.shutdown_timeout</code> <br/><nobr>N</nobr></td><td width=40></td>
232 <td>
233 (Since v3.3.0) Sets the duration in seconds Lanes will wait for graceful termination of running lanes at application shutdown. Irrelevant for builds using pthreads. Default is <tt>0.25</tt>.
234 </td></tr>
229 </table> 235 </table>
230<h2 id="creation">Creation</h2> 236<h2 id="creation">Creation</h2>
231 237
@@ -292,7 +298,7 @@ also in the new lanes.
292 <tr><td/><td><tt>"string"</tt></td><td/><td><tt>string.*</tt> namespace</td></tr> 298 <tr><td/><td><tt>"string"</tt></td><td/><td><tt>string.*</tt> namespace</td></tr>
293 <tr><td/><td><tt>"table"</tt></td><td/><td><tt>table.*</tt> namespace</td></tr> 299 <tr><td/><td><tt>"table"</tt></td><td/><td><tt>table.*</tt> namespace</td></tr>
294 <br/> 300 <br/>
295 <tr><td/><td><tt>"*"</tt></td><td/><td>all standard libraries</td></tr> 301 <tr><td/><td><tt>"*"</tt></td><td/><td>all standard libraries (including those specific to LuaJIT and not listed above)</td></tr>
296 </table> 302 </table>
297 303
298</p><p> 304</p><p>
@@ -318,7 +324,7 @@ also in the new lanes.
318 <code>.globals</code> <br/>globals_tbl</td><td/> 324 <code>.globals</code> <br/>globals_tbl</td><td/>
319 <td> 325 <td>
320 Sets the globals table for the launched threads. This can be used for giving 326 Sets the globals table for the launched threads. This can be used for giving
321 them constants. 327 them constants. The key/value pairs of <tt>globals_tbl</tt> are transfered in the lane globals after the libraries have been loaded and the modules required.
322 <br> 328 <br>
323 The global values of different lanes are in no manner connected; 329 The global values of different lanes are in no manner connected;
324 modifying one will only affect the particular lane. 330 modifying one will only affect the particular lane.
@@ -354,7 +360,7 @@ also in the new lanes.
354 <td><td/> 360 <td><td/>
355 <code>package</code> contents overrides, if needed. 361 <code>package</code> contents overrides, if needed.
356 Specifying it when <code>libs_str</code> doesn't cause the <code>package</code> library to be loaded will generate an error. 362 Specifying it when <code>libs_str</code> doesn't cause the <code>package</code> library to be loaded will generate an error.
357 If not specified, the created lane will receive the current values of <tt>package</tt>. Only path, cpath, preload and loaders are transfered. 363 If not specified, the created lane will receive the current values of <tt>package</tt>. Only <tt>path</tt>, <tt>cpath</tt>, <tt>preload</tt> and <tt>loaders</tt> are transfered.
358 <br> 364 <br>
359 </td> 365 </td>
360 </tr> 366 </tr>
@@ -406,9 +412,10 @@ member, providing one of these values: <sup>(<a href="#2">2</a></sup>
406 <tr><td width=40><td><tt>"pending"</tt></td><td>not started, yet</td></tr> 412 <tr><td width=40><td><tt>"pending"</tt></td><td>not started, yet</td></tr>
407 <tr><td/><td><tt>"running"</tt></td><td>running</td></tr> 413 <tr><td/><td><tt>"running"</tt></td><td>running</td></tr>
408 <tr><td/><td><tt>"waiting"</tt></td><td>waiting at a Linda <tt>:receive()</tt> or <tt>:send()</tt></td></tr> 414 <tr><td/><td><tt>"waiting"</tt></td><td>waiting at a Linda <tt>:receive()</tt> or <tt>:send()</tt></td></tr>
409 <tr><td/><td><tt>"done"</tt></td><td>finished executing (results are ready)</td></tr> 415 <tr><td/><td><tt>"done"</tt></td><td>finished executing (results are ready)</td></tr>
410 <tr><td/><td><tt>"error"</tt></td><td>met an error (reading results will propagate it)</td></tr> 416 <tr><td/><td><tt>"error"</tt></td><td>met an error (reading results will propagate it)</td></tr>
411 <tr><td/><td><tt>"cancelled"</tt></td><td>received cancellation and finished itself</td></tr> 417 <tr><td/><td><tt>"cancelled"</tt></td><td>received cancellation and finished itself</td></tr>
418 <tr><td/><td><tt>"killed"</tt></td><td>was forcefully killed by <tt>lane_h:cancel()</tt> (since v3.3.0)</td></tr>
412 </table> 419 </table>
413</p><p> 420</p><p>
414 This is similar to <tt>coroutine.status</tt>, which has: <tt>"running"</tt> / 421 This is similar to <tt>coroutine.status</tt>, which has: <tt>"running"</tt> /
@@ -441,8 +448,9 @@ If the lane ended in an error, it is propagated to master state at this place.
441<p> 448<p>
442Waits until the lane finishes, or <tt>timeout</tt> seconds have passed. 449Waits until the lane finishes, or <tt>timeout</tt> seconds have passed.
443Returns <tt>nil</tt> on timeout, <tt>nil,err,stack_tbl</tt> if the lane hit an error, 450Returns <tt>nil</tt> on timeout, <tt>nil,err,stack_tbl</tt> if the lane hit an error,
444or the return values of the lane. Unlike in reading the results in table 451<tt>nil, "killed"</tt> if forcefully killed (starting with v3.3.0), or the return values of the lane.
445fashion, errors are not propagated. 452Unlike in reading the results in table fashion, errors are not propagated.
453
446</p><p> 454</p><p>
447 455
448<table border=1 bgcolor="#E0E0FF" cellpadding=10><tr><td> 456<table border=1 bgcolor="#E0E0FF" cellpadding=10><tr><td>
@@ -490,7 +498,7 @@ that id over a Linda once that thread is done (as the last thing you do).
490<h2 id="cancelling">Cancelling</h2> 498<h2 id="cancelling">Cancelling</h2>
491 499
492<table border=1 bgcolor="#E0E0FF" cellpadding=10><tr><td> 500<table border=1 bgcolor="#E0E0FF" cellpadding=10><tr><td>
493 <code>bool= lane_h:cancel( [timeout_secs=0.0,] [force_kill_bool=false] ) 501 <code>bool[,reason]= lane_h:cancel( [timeout_secs=0.0,] [force_kill_bool=false] )</code>
494 <br/> 502 <br/>
495 <br/> 503 <br/>
496 <code> 504 <code>
@@ -507,6 +515,9 @@ If the lane is still running and <tt>force_kill</tt> is <tt>true</tt>, the
507OS thread running the lane is forcefully killed. This means no GC, and should 515OS thread running the lane is forcefully killed. This means no GC, and should
508generally be the last resort. 516generally be the last resort.
509</p> 517</p>
518<p>
519Starting with v3.3.0, if <tt>cancel()</tt> returns false, it also returns either <tt>"timeout"</tt> or <tt>"killed"</tt> as second return value.
520</p>
510<p>Cancellation is tested <u>before</u> going to sleep in <tt>receive()</tt> or <tt>send()</tt> calls 521<p>Cancellation is tested <u>before</u> going to sleep in <tt>receive()</tt> or <tt>send()</tt> calls
511and after executing <tt>cancelstep</tt> Lua statements. Starting with version 3.0-beta, a pending <tt>receive()</tt> 522and after executing <tt>cancelstep</tt> Lua statements. Starting with version 3.0-beta, a pending <tt>receive()</tt>
512or <tt>send()</tt> call is awakened. This means the execution of the lane will resume although the operation has 523or <tt>send()</tt> call is awakened. This means the execution of the lane will resume although the operation has