From 242feeb342f68999b02c2b8dc4614abefdab8431 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 10 Sep 2012 20:41:03 +0200 Subject: 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[]: 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( , 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. --- docs/index.html | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'docs') 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 @@


Copyright © 2007-12 Asko Kauppi, Benoit Germain. All rights reserved.
Lua Lanes is published under the same MIT license as Lua 5.1 and 5.2. -

This document was revised on 21-Aug-12, and applies to version 3.2.0 +

This document was revised on 10-Sep-12, and applies to version 3.3.0

@@ -205,7 +205,7 @@ Or use Lua Rocks package m .nb_keepers
N - Controls the number of keeper states used internally by lindas to transfer data between lanes. (see below). Default is 1. + Controls the number of keeper states used internally by lindas to transfer data between lanes. (see below). Default is 1. @@ -213,7 +213,7 @@ Or use Lua Rocks package m If equal to false, Lanes doesn't start the timer service, and the associated API will be absent from the interface (see below). - Any other value (including nil), starts the timer service. + Any other value (including nil), starts the timer service. Default is true. @@ -223,9 +223,15 @@ Or use Lua Rocks package m If provided, will be called in every created Lua state (keepers and lanes) right after it is created, and *before* any library is loaded. - That way, all C functions it loads in the state can be added to the function lookup database. + That way, all C functions it loads in the state can be added to the function lookup database. Default is nil. + + + .shutdown_timeout
N + + (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 0.25. +

Creation

@@ -292,7 +298,7 @@ also in the new lanes. "string"string.* namespace "table"table.* namespace
- "*"all standard libraries + "*"all standard libraries (including those specific to LuaJIT and not listed above)

@@ -318,7 +324,7 @@ also in the new lanes. .globals
globals_tbl Sets the globals table for the launched threads. This can be used for giving - them constants. + them constants. The key/value pairs of globals_tbl are transfered in the lane globals after the libraries have been loaded and the modules required.
The global values of different lanes are in no manner connected; modifying one will only affect the particular lane. @@ -354,7 +360,7 @@ also in the new lanes. package contents overrides, if needed. Specifying it when libs_str doesn't cause the package library to be loaded will generate an error. - If not specified, the created lane will receive the current values of package. Only path, cpath, preload and loaders are transfered. + If not specified, the created lane will receive the current values of package. Only path, cpath, preload and loaders are transfered.
@@ -406,9 +412,10 @@ member, providing one of these values: (2 "pending"not started, yet "running"running "waiting"waiting at a Linda :receive() or :send() - "done"finished executing (results are ready) + "done"finished executing (results are ready) "error"met an error (reading results will propagate it) "cancelled"received cancellation and finished itself + "killed"was forcefully killed by lane_h:cancel() (since v3.3.0)

This is similar to coroutine.status, which has: "running" / @@ -441,8 +448,9 @@ If the lane ended in an error, it is propagated to master state at this place.

Waits until the lane finishes, or timeout seconds have passed. Returns nil on timeout, nil,err,stack_tbl if the lane hit an error, -or the return values of the lane. Unlike in reading the results in table -fashion, errors are not propagated. +nil, "killed" if forcefully killed (starting with v3.3.0), or the return values of the lane. +Unlike in reading the results in table fashion, errors are not propagated. +

@@ -490,7 +498,7 @@ that id over a Linda once that thread is done (as the last thing you do).

Cancelling

- bool= lane_h:cancel( [timeout_secs=0.0,] [force_kill_bool=false] ) + bool[,reason]= lane_h:cancel( [timeout_secs=0.0,] [force_kill_bool=false] )

@@ -507,6 +515,9 @@ If the lane is still running and force_kill is true, the OS thread running the lane is forcefully killed. This means no GC, and should generally be the last resort.

+

+Starting with v3.3.0, if cancel() returns false, it also returns either "timeout" or "killed" as second return value. +

Cancellation is tested before going to sleep in receive() or send() calls and after executing cancelstep Lua statements. Starting with version 3.0-beta, a pending receive() or send() call is awakened. This means the execution of the lane will resume although the operation has -- cgit v1.2.3-55-g6feb