From efd14c278c72674fc58cfde2f9023450a755c604 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 3 Mar 2026 17:18:10 +0100 Subject: Shamelessly grab Lua's CSS and use them for ourselves in the documentation --- docs/index.css | 29 ++ docs/index.html | 911 ++++++++++++++++++++++++++++---------------------------- docs/lua.css | 162 ++++++++++ docs/manual.css | 21 ++ 4 files changed, 663 insertions(+), 460 deletions(-) create mode 100644 docs/index.css create mode 100644 docs/lua.css create mode 100644 docs/manual.css (limited to 'docs') diff --git a/docs/index.css b/docs/index.css new file mode 100644 index 0000000..6a6e163 --- /dev/null +++ b/docs/index.css @@ -0,0 +1,29 @@ +ul { + list-style-type: none ; +} + +ul.contents { + padding: 0 ; +} + +table { + border: none ; + border-spacing: 0 ; + border-collapse: collapse ; +} + +td { + vertical-align: top ; + padding: 0 ; + text-align: left ; + line-height: 1.25 ; + width: 15% ; +} + +table.striped tr:nth-child(even) { + background-color: #E8E8E8 ; +} + +table.striped tr:nth-child(odd) { + background-color: #F4F4F4 ; +} diff --git a/docs/index.html b/docs/index.html index a36119e..63dfedc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,6 +9,11 @@ Lua Lanes - multithreading in Lua + + + + + @@ -19,7 +24,7 @@
- - +
+ Lua Lua @@ -30,7 +35,7 @@

Lua Lanes - multithreading in Lua

Lua Lanes - multithreading in Lua

@@ -62,18 +67,16 @@

- -

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

- -

- This document was revised on 26-Feb-2026, and applies to version 4.0.0. -

-
+

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

+ +

+ This document was revised on 3-Mar-2026, and applies to version 4.0.0. +

@@ -86,7 +89,7 @@ Lua Lanes is a Lua extension library providing the possibility to run multiple Lua states in parallel. It is intended to be used for optimizing performance on multicore CPU's and to study ways to make Lua programs naturally parallel to begin with.

- Lanes is included into your software by the regular require "lanes" method. No C side programming is needed; all APIs are Lua side, and most existing extension modules should work seamlessly together with the multiple lanes. + Lanes is included into your software by the regular require "lanes" method. No C side programming is needed; all APIs are Lua side, and most existing extension modules should work seamlessly together with the multiple lanes.

Lanes should build and run identically with either Lua 5.1 to Lua 5.5, as well as LuaJIT. @@ -153,11 +156,11 @@

Building and Installing

- Lua Lanes is implemented in C++20. It is built simply by make on the supported platforms (make-vc for Visual C++). See README for system specific details and limitations. + Lua Lanes is implemented in C++20. It is built simply by make on the supported platforms (make-vc for Visual C++). See README for system specific details and limitations.

- To install Lanes, all you need are the lanes.lua and lanes_core.so|dll files to be reachable by Lua (see LUA_PATH, LUA_CPATH). + To install Lanes, all you need are the lanes.lua and lanes_core.so|dll files to be reachable by Lua (see LUA_PATH, LUA_CPATH). Or use Lua Rocks package management.

@@ -175,76 +178,76 @@

API Cheat sheet

@@ -264,9 +267,9 @@

- luaopen_lanes_embedded leaves the module table on the stack. lanes.configure() must still be called in order to use Lanes. + luaopen_lanes_embedded leaves the module table on the stack. lanes.configure() must still be called in order to use Lanes.
- If _luaopen_lanes is nullptr, a default loader will simply attempt the equivalent of luaL_dofile(L, "lanes.lua"). + If _luaopen_lanes is nullptr, a default loader will simply attempt the equivalent of luaL_dofile(L, "lanes.lua").

@@ -277,33 +280,34 @@
-
	#include "lanes.hpp"
-
-
	int load_lanes_lua(lua_State* L)
-
	{
-
		// retrieve lanes.lua from wherever it is stored and return the result of its execution
-
		// trivial example 1:
-
		luaL_dofile(L, "lanes.lua");
-
-
		// trivial example 2:
-
		luaL_dostring(L, bin2c_lanes_lua);
-
	}
-
-
	void embed_lanes(lua_State* L)
-
	{
-
		// we need base libraries for Lanes for work
-
		luaL_openlibs(L);
-
		...
-
		// will attempt luaL_dofile(L, "lanes.lua");
-
		luaopen_lanes_embedded(L, nullptr);
-
		lua_pop(L, 1);
-
		// another example with a custom loader
-
		luaopen_lanes_embedded(L, load_lanes_lua);
-
		lua_pop(L, 1);
-
-
		// a little test to make sure things work as expected
-
		luaL_dostring(L, "local lanes = require 'lanes'.configure{with_timers = false}; local l = lanes.linda()");
-
	}
+
+	#include "lanes.hpp"
+
+	int load_lanes_lua(lua_State* L)
+	{
+		// retrieve lanes.lua from wherever it is stored and return the result of its execution
+		// trivial example 1:
+		luaL_dofile(L, "lanes.lua");
+
+		// trivial example 2:
+		luaL_dostring(L, bin2c_lanes_lua);
+	}
+
+	void embed_lanes(lua_State* L)
+	{
+		// we need base libraries for Lanes for work
+		luaL_openlibs(L);
+		...
+		// will attempt luaL_dofile(L, "lanes.lua");
+		luaopen_lanes_embedded(L, nullptr);
+		lua_pop(L, 1);
+		// another example with a custom loader
+		luaopen_lanes_embedded(L, load_lanes_lua);
+		lua_pop(L, 1);
+
+		// a little test to make sure things work as expected
+		luaL_dostring(L, "local lanes = require 'lanes'.configure{with_timers = false}; local l = lanes.linda()");
+	}
 			
@@ -327,17 +331,17 @@

- Requiring the module follows Lua 5.2+ rules: the module is not available under the global name "lanes", but has to be accessed through require's return value.
- Lanes needs "base", "string" and "table" to be initialized beforehand (plus "jit" for LuaJIT). + Requiring the module follows Lua 5.2+ rules: the module is not available under the global name "lanes", but has to be accessed through require's return value.
+ Lanes needs "base", "string" and "table" to be initialized beforehand (plus "jit" for LuaJIT).

- After lanes is required, it is recommended to call lanes.configure(), which is the only function exposed by the module at this point. Calling lanes.configure() will perform one-time initializations and make the rest of the API available.
- If lanes.configure() is not called before starting to use Lanes, it will be called automatically for you with default settings.
- Only the first occurence of require "lanes" must be followed by a call to lanes.configure(). From this point, a simple require "lanes" will be enough wherever you need to require lanes again.
- After being called, lanes.configure() itself is replaced by another function that does nothing with the argument it receives, in case it happens to be called again. + After lanes is required, it is recommended to call lanes.configure(), which is the only function exposed by the module at this point. Calling lanes.configure() will perform one-time initializations and make the rest of the API available.
+ If lanes.configure() is not called before starting to use Lanes, it will be called automatically for you with default settings.
+ Only the first occurence of require "lanes" must be followed by a call to lanes.configure(). From this point, a simple require "lanes" will be enough wherever you need to require lanes again.
+ After being called, lanes.configure() itself is replaced by another function that does nothing with the argument it receives, in case it happens to be called again.

- Also, once Lanes is initialized, require() is replaced by another one that wraps it inside a mutex, both in the main state and in all created lanes. This prevents multiple thread-unsafe module initializations from several lanes to occur simultaneously. + Also, once Lanes is initialized, require() is replaced by another one that wraps it inside a mutex, both in the main state and in all created lanes. This prevents multiple thread-unsafe module initializations from several lanes to occur simultaneously. It remains to be seen whether this is actually useful or not: If a module is already threadsafe, protecting its initialization isn't useful. And if it is not, any parallel operation may crash without Lanes being able to do anything about it.

@@ -352,11 +356,11 @@

- lanes.configure accepts an optional table as sole argument. - + lanes.configure accepts an optional table as sole argument. +
- - + + @@ -365,26 +369,28 @@ .allocator @@ -394,10 +400,12 @@ .convert_fallback @@ -418,12 +426,13 @@ .internal_allocator @@ -436,7 +445,7 @@ @@ -446,11 +455,11 @@ .linda_wake_period - + @@ -474,19 +483,20 @@ .on_state_create @@ -498,10 +508,10 @@ number >= 0 @@ -511,10 +521,10 @@ .strip_functions @@ -522,11 +532,11 @@ .track_lanes @@ -535,11 +545,11 @@ .verbose_errors @@ -548,11 +558,11 @@ .with_timers
namevaluenamevalues definition
- nil/"protected"/function + nil
+ "protected"
+ function
- If nil, Lua states are created with lua_newstate() and reuse the allocator from the master state.
- If "protected", The default allocator obtained from lua_getallocf() in the master state is wrapped inside a critical section and used in all newly created states.
- If a function, this function is called prior to creating the state, with a single string argument, either "internal", "keeper" or "lane". It should return a full userdata created as follows: - + If nil, Lua states are created with lua_newstate() and reuse the allocator from the master state.
+ If "protected", The default allocator obtained from lua_getallocf() in the master state is wrapped inside a critical section and used in all newly created states.
+ If a function, this function is called prior to creating the state, with a single string argument, either "internal", "keeper" or "lane". It should return a full userdata created as follows: +
-	static constexpr lua_CFunction _provideAllocator = +[](lua_State* const L_) {
-		lanes::AllocatorDefinition* const _def{ new (L_) lanes::AllocatorDefinition{} };
-		// populate _def->allocF and _def->allocUD here
-		return 1;
-	};
+static constexpr lua_CFunction _provideAllocator = +[](lua_State* const L_) {
+	lanes::AllocatorDefinition* const _def{ new (L_) lanes::AllocatorDefinition{} };
+	// populate _def->allocF and _def->allocUD here
+	return 1;
+};
 							
- The contents will be used to create the state with lua_newstate(allocF, allocUD). + The contents will be used to create the state with lua_newstate(allocF, allocUD). This option is mostly useful for embedders that want to provide different allocators to each lane, for example to have each one work in a different memory pool thus preventing the need for the allocator itself to be threadsafe.
- nil, lanes.null or 'decay' + nil
+ lanes.null
+ 'decay'
- Same as __lanesconvert (see Limitations on data passing), but cannot be a function, because this would have to be transferred to all newly created lanes. + Same as __lanesconvert (see Limitations on data passing), but cannot be a function, because this would have to be transferred to all newly created lanes.
- "libc"/"allocator" + "libc"
+ "allocator"
Controls which allocator is used for Lanes internal allocations (for Keeper state, linda and lane management). - If "libc", Lanes uses realloc and free.
- If "allocator", Lanes uses whatever was obtained from the "allocator" setting.
+ If "libc", Lanes uses realloc and free.
+ If "allocator", Lanes uses whatever was obtained from the "allocator" setting.
This option is mostly useful for embedders that want control all memory allocations, but have issues when Lanes tries to use the Lua State allocator for internal purposes (especially with LuaJIT).
If <0, GC runs automatically. This is the default.
If 0, GC runs after *every* Keeper operation.
- If >0, Keeper states run GC manually with lua_gc(LUA_GCCOLLECT) whenever memory usage reported by lua_gc(LUA_GCCOUNT) reaches this threshold. + If >0, Keeper states run GC manually with lua_gc(LUA_GCCOLLECT) whenever memory usage reported by lua_gc(LUA_GCCOUNT) reaches this threshold. Check is made after every operation (see below). If memory usage remains above threshold after the GC cycle, an error is raised.
- number > 0 + number > 0 Sets the default period in seconds a linda will wake by itself during blocked operations. Default is never.
- When a linda enters a blocking call (send(), receive(), receive_batched(), sleep()), it normally sleeps either until the operation completes + When a linda enters a blocking call (send(), receive(), receive_batched(), sleep()), it normally sleeps either until the operation completes or the specified timeout expires. With this setting, the default behavior can be changed to wake periodically. This can help for example with timing issues where a lane is signalled for cancellation, but a linda inside the lane was in the middle of processing an operation but did not actually start the wait. This can result in the signal to be ignored, thus causing the linda to wait out the full operation timeout before cancellation is processed. @@ -461,10 +470,10 @@
.nb_user_keepers integer in [0,100]0 ≤ number ≤ 100 - Controls the number of "user" Keeper state used internally by linda) objects to transfer data between lanes. Default is 0.
- Lanes always creates at least one keeper state (of group 0 for the internal timer linda. If nb_user_keepers is 0, the other lindas you create will share this keeper by necessity.
+ Controls the number of "user" Keeper state used internally by linda) objects to transfer data between lanes. Default is 0.
+ Lanes always creates at least one keeper state (of group 0 for the internal timer linda. If nb_user_keepers is 0, the other lindas you create will share this keeper by necessity.
If there is more than one Keeper state (in total), linda creation must specify the group it belongs to.
- nil/function + nil
+ function
- If provided, will be called in every created Lua state right after initializing the base libraries, with a single string argument, either "lane" or "keeper".
+ If provided, will be called in every created Lua state right after initializing the base libraries, with a single string argument, either "lane" or "keeper".
If it is a C function, a C closure will be reconstructed in the created state from the C pointer. Lanes will raise an error if the function has upvalues.
If it is a Lua function, it will be transfered normally before the call.
Keeper states will call it as well, but only if it is a C function (Keeper states are not able to execute any user Lua code).
Typical usage is twofold:
    -
  • Tweak package.loaders
  • +
  • Tweak package.loaders
  • Load some additional C functions in the global space (of course only a C function will be able to do this).
- That way, all changes in the state can be properly taken into account when building the function lookup database. Default is nil.
+ That way, all changes in the state can be properly taken into account when building the function lookup database. Default is nil.
- Sets the duration in seconds Lanes will wait for graceful termination of running lanes at application shutdown. Default is 0.25.
- Lanes signals all lanes for cancellation with "soft", "hard", and "all" modes, in that order. Each attempt has shutdown_timeout seconds to succeed before the next one.
- Then there is a last chance at cleanup with lanes.finally(). If some lanes are still running after that point, shutdown will either freeze or throw. It is YOUR responsibility to cleanup properly after yourself. - IMPORTANT: If there are still running lanes at shutdown, an error is raised, which will be propagated by Lua to the handler installed by lua_setwarnf. If the finalizer returned a value, this will be used as the error message.
+ Sets the duration in seconds Lanes will wait for graceful termination of running lanes at application shutdown. Default is 0.25.
+ Lanes signals all lanes for cancellation with "soft", "hard", and "all" modes, in that order. Each attempt has shutdown_timeout seconds to succeed before the next one.
+ Then there is a last chance at cleanup with lanes.finally(). If some lanes are still running after that point, shutdown will either freeze or throw. It is YOUR responsibility to cleanup properly after yourself. + IMPORTANT: If there are still running lanes at shutdown, an error is raised, which will be propagated by Lua to the handler installed by lua_setwarnf. If the finalizer returned a value, this will be used as the error message.
LANES SHUTDOWN WILL NOT BE COMPLETE IN THAT CASE, AND THE SUBSEQUENT CONSEQUENCES ARE UNDEFINED!
- nil/boolean + nil/boolean - Controls function bytecode stripping when dumping them for lane transfer. Choose between faster copies or more debug info. Default is true. + Controls function bytecode stripping when dumping them for lane transfer. Choose between faster copies or more debug info. Default is true.
- nil/boolean + nil/boolean - Any non-nil|false value instructs Lanes keeps track of all lanes, so that lanes.threads() can list them. If false, lanes.threads() will raise an error when called. - Default is false. + Any non-nil|false value instructs Lanes keeps track of all lanes, so that lanes.threads() can list them. If false, lanes.threads() will raise an error when called. + Default is false.
- nil/boolean + nil/boolean - If equal to true, Lanes will collect more information when transfering stuff across Lua states to help identify errors (with a cost). - Default is false. + If equal to true, Lanes will collect more information when transfering stuff across Lua states to help identify errors (with a cost). + Default is false.
- nil/boolean + nil/boolean - If equal to false or nil, Lanes doesn't start the timer service, and the associated API will be absent from the interface (see below). - Default is false. + If equal to false or nil, Lanes doesn't start the timer service, and the associated API will be absent from the interface (see below). + Default is false.
@@ -561,23 +571,25 @@

Once Lanes is configured, one should register with Lanes the modules exporting functions/userdata that will be transferred either during lane generation or through lindas.
- Use lanes.require() for this purpose. This will call the original require(), then add the result to the lookup databases. + Use lanes.require() for this purpose. This will call the original require(), then add the result to the lookup databases.
- It is also possible to register a given module a posteriori with lanes.register(). This function will raise an error if the registered module is not a function, table, or full userdata.
- Embedders can call the equivalent function lanes_register() from the C side, through lua_call() or similar. + It is also possible to register a given module a posteriori with lanes.register(). This function will raise an error if the registered module is not a function, table, or full userdata.
+ Embedders can call the equivalent function lanes_register() from the C side, through lua_call() or similar.

-
	local m = lanes.require "modname"
-
	lanes.register("modname", module)
+
+	local m = lanes.require "modname"
+	lanes.register("modname", module)
+			

- A full GC cycle can be triggered on all keeper states with lanes.collectgarbage(). This can force the collection of stale storage data for a collected Linda. + A full GC cycle can be triggered on all keeper states with lanes.collectgarbage(). This can force the collection of stale storage data for a collected Linda.

@@ -606,11 +618,11 @@

An error will be raised if you attempt to do this from inside a lane, or on bad arguments (non-function, or too many arguments).
- Only the last registered finalizer is kept. It can be cleared by passing nil or nothing.
- The finalizer is called unprotected from inside __gc metamethod of Lanes's Universe. Therefore, if your finalizer raises an error, Lua rules regarding errors in finalizers apply normally.
- The installed function is called after all free-running lanes got a chance to terminate (see shutdown_timeout), but before lindas become unusable.
- The finalizer receives a single argument, a bool indicating whether all Lanes are successfully terminated at that point. It is possible to inspect them with tracking.
- If there are still running lanes when the finalizer returns: If the finalizer returned "freeze", Lanes will freeze inside the Universe __gc. Any other value will cause Lanes to raise it as an error. If there is no return value, a default message will be used. + Only the last registered finalizer is kept. It can be cleared by passing nil or nothing.
+ The finalizer is called unprotected from inside __gc metamethod of Lanes's Universe. Therefore, if your finalizer raises an error, Lua rules regarding errors in finalizers apply normally.
+ The installed function is called after all free-running lanes got a chance to terminate (see shutdown_timeout), but before lindas become unusable.
+ The finalizer receives a single argument, a bool indicating whether all Lanes are successfully terminated at that point. It is possible to inspect them with tracking.
+ If there are still running lanes when the finalizer returns: If the finalizer returned "freeze", Lanes will freeze inside the Universe __gc. Any other value will cause Lanes to raise it as an error. If there is no return value, a default message will be used.


@@ -623,13 +635,15 @@
-
	local lanes = require "lanes"
-
-
	f = lanes.gen(function(n) return 2 * n end)
-
	a = f(1)
-
	b = f(2)
-
-
	print(a[1], b[1])     -- 2    4
+
+	local lanes = require "lanes"
+
+	f = lanes.gen(function(n) return 2 * n end)
+	a = f(1)
+	b = f(2)
+
+	print(a[1], b[1])     -- 2    4
+			
@@ -637,191 +651,182 @@
-
	func = lanes.gen([libs_str | opt_tbl [, ...],] lane_func)
-
	lane_h = func(...)
+
+	func = lanes.gen([libs_str | opt_tbl [, ...],] lane_func)
+	lane_h = func(...)
+			

- The function returned by lanes.gen() is a "generator" for launching any number of lanes. They will share code, options, initial globals, but the particular arguments may vary. Only calling the generator function actually launches a lane, and provides a handle for controlling it. + The function returned by lanes.gen() is a "generator" for launching any number of lanes. They will share code, options, initial globals, but the particular arguments may vary. Only calling the generator function actually launches a lane, and provides a handle for controlling it.
- Alternatively, lane_func may be a string, in which case it will be compiled in the lane. This was to be able to launch a lane with older versions of LuaJIT, which didn't not support lua_dump, used internally to transfer functions to the lane. + Alternatively, lane_func may be a string, in which case it will be compiled in the lane. This was to be able to launch a lane with older versions of LuaJIT, which didn't not support lua_dump, used internally to transfer functions to the lane.

- Lanes automatically copies upvalues over to the new lanes, so you need not wrap all the required elements into one 'wrapper' function. If lane_func uses some local values, or local functions, they will be there also in the new lanes. + Lanes automatically copies upvalues over to the new lanes, so you need not wrap all the required elements into one 'wrapper' function. If lane_func uses some local values, or local functions, they will be there also in the new lanes.

libs_str defines the standard libraries made available to the new Lua state: - +
+ + + + + - - + - - - - - - - - - - - - - - -
namedefinition
- nil + nil no standard libraries (default)
- "base" + "base" - _G namespace (the default function environment): print, assert, dofile, etc. + _G namespace (the default function environment): print, assert, dofile, etc.
- "bit" + "bit" - bit.* namespace (LuaJIT) + bit.* namespace (LuaJIT)
- "bit32" + "bit32" - bit32.* namespace (Lua 5.1 and 5.2) + bit32.* namespace (Lua 5.1 and 5.2)
- "coroutine" + "coroutine" - coroutine.* namespace (part of base in Lua 5.1 and 5.2) + coroutine.* namespace (part of base in Lua 5.1 and 5.2)
- "debug" + "debug" - debug.* namespace + debug.* namespace
- "ffi" + "ffi" - ffi.* namespace (LuaJIT) + ffi.* namespace (LuaJIT)
- "io" + "io" - io.* namespace + io.* namespace
- "jit" + "jit" - jit.* namespace (LuaJIT) + jit.* namespace (LuaJIT)
- "math" + "math" - math.* namespace + math.* namespace
- "os" + "os" - os.* namespace + os.* namespace
- "package" + "package" - package.* namespace and require + package.* namespace and require
- "string" + "string" - string.* namespace + string.* namespace
- "table" + "table" - table.* namespace + table.* namespace
- "utf8" + "utf8" - utf8.* namespace (Lua 5.3 and above) + utf8.* namespace (Lua 5.3 and above)
- "*" + "*" - All standard libraries (including those specific to LuaJIT and not listed above), as well as lanes_core. This must be used alone. + All standard libraries (including those specific to LuaJIT and not listed above), as well as lanes_core. This must be used alone.

- Any non-nil value causes initialization of "base" and "jit" (the latter only for LuaJIT-based builds).
- Library names may contain characters matching std::isalnum(c_) || c_ == '.' || c_ == '-' || c_ == '_'. Anything else is considered a valid name separator.
- Trying to load a library not supported by the running Lua flavor will raise an error, unless the library name is postfixed with a '?'.
- Initializing the standard libs takes a bit of time at each lane invocation. This is the main reason why "no libraries" is the default. + Any non-nil value causes initialization of "base" and "jit" (the latter only for LuaJIT-based builds).
+ Library names may contain characters matching std::isalnum(c_) || c_ == '.' || c_ == '-' || c_ == '_'. Anything else is considered a valid name separator.
+ Trying to load a library not supported by the running Lua flavor will raise an error, unless the library name is postfixed with a '?'.
+ Initializing the standard libraries takes a bit of time at each lane creation. This is the main reason why "no libraries" is the default.

@@ -830,11 +835,11 @@

- +
- - + + @@ -853,9 +858,9 @@ @@ -865,8 +870,8 @@ @@ -876,7 +881,7 @@ @@ -885,7 +890,7 @@ @@ -895,10 +900,10 @@ @@ -908,23 +913,23 @@
namevaluedefinitionvaluedefinition
@@ -842,7 +847,7 @@ table - Sets the globals table for the launched threads. This can be used for giving them constants. The key/value pairs of table are transfered in the lane globals after the libraries have been loaded and the modules required.
+ Sets the globals table for the launched threads. This can be used for giving them constants. The key/value pairs of table 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.
table Lists modules that have to be required in order to be able to transfer functions/userdata they exposed. Non-Lua functions are searched in lookup tables. - These tables are built from the modules listed here. required must be an array of strings, each one being the name of a module to be required. Each module is required with require() before the lane function is invoked. + These tables are built from the modules listed here. required must be an array of strings, each one being the name of a module to be required. Each module is required with require() before the lane function is invoked. So, from the required module's point of view, requiring it manually from inside the lane body or having it required this way doesn't change anything. From the lane body's point of view, the only difference is that a module not creating a global won't be accessible. - Therefore, a lane body will also have to require a module manually, but this won't do anything more (see Lua's require documentation).
+ Therefore, a lane body will also have to require a module manually, but this won't do anything more (see Lua's require documentation).
ATTEMPTING TO TRANSFER A FUNCTION REGISTERED BY A MODULE NOT LISTED HERE WILL RAISE AN ERROR.
string - Sets the error reporting mode. One of "minimal" (the default), "basic", "extended".
- "minimal" yields only the location of the error.
+ Sets the error reporting mode. One of "minimal" (the default), "basic", "extended".
+ "minimal" yields only the location of the error.
The other two options yield a full stack trace, with different amounts of data extracted from the debug infos. See Results.
string - Name of the lane. If "auto", name is built from ar.short_src:ar.linedefined. Can be changed later from the inside of the lane with lane_threadname() (see below). + Name of the lane. If "auto", name is built from ar.short_src:ar.linedefined. Can be changed later from the inside of the lane with lane_threadname() (see below).
function - Callback that gets invoked when the lane is garbage collected. The function receives two arguments (the lane name and a string, either "closed" or "selfdestruct"). + Callback that gets invoked when the lane is garbage collected. The function receives two arguments (the lane name and a string, either "closed" or "selfdestruct").
integer - priority: The priority of lanes in the range [-3,+3] (default is 0). These values are a mapping over the actual priority range of the underlying implementation.
- native_priority: The priority of lanes in a platform-dependent range. Use lanes.thread_priority_range() to query said range. + priority: The priority of lanes in the range [-3,+3] (default is 0). These values are a mapping over the actual priority range of the underlying implementation.
+ native_priority: The priority of lanes in a platform-dependent range. Use lanes.thread_priority_range() to query said range. Implementation and dependability of priorities varies by platform. Especially Linux kernel 2.6 is not supporting priorities in user mode.
- A lane can also change its own thread priority dynamically with lanes.set_thread_priority(). + A lane can also change its own thread priority dynamically with lanes.set_thread_priority().
table 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 (Lua 5.1)/searchers (Lua 5.2) are transfered. + If not specified, the created lane will receive the current values of package. Only path, cpath, preload and loaders (Lua 5.1)/searchers (Lua 5.2) are transfered.

- Each lane gets a global function lane_threadname() that it can use anytime to do both read and change the thread name. Supported debuggers are Microsoft Visual Studio (for the C side) and Decoda (for the Lua side).
- Change HAVE_DECODA_SUPPORT() in lanesconf.h to enable the Decoda support, that sets a special global variable decoda_name in the lane's state.
- The name is stored inside the Lua state registry so that it is available for error reporting. Changing decoda_name doesn't affect this hidden name or the OS thread name reported by MSVC.
- When Lanes is initialized by the first lanes.configure() call, "main" is stored in the registry in the same fashion (but decoda_name and the OS thread name are left unchanged).
- The lane also has a method lane:get_threadname() that gives access to that name from the caller side (returns "<unnamed>" if unset).
- With Lua 5.4+, Lanes have a __close metamethod, meaning they can be declared to-be-closed. __close calls lane:join(nil). + Each lane gets a global function lane_threadname() that it can use anytime to do both read and change the thread name. Supported debuggers are Microsoft Visual Studio (for the C side) and Decoda (for the Lua side).
+ Change HAVE_DECODA_SUPPORT() in lanesconf.h to enable the Decoda support, that sets a special global variable decoda_name in the lane's state.
+ The name is stored inside the Lua state registry so that it is available for error reporting. Changing decoda_name doesn't affect this hidden name or the OS thread name reported by MSVC.
+ When Lanes is initialized by the first lanes.configure() call, "main" is stored in the registry in the same fashion (but decoda_name and the OS thread name are left unchanged).
+ The lane also has a method lane:get_threadname() that gives access to that name from the caller side (returns "<unnamed>" if unset).
+ With Lua 5.4+, Lanes have a __close metamethod, meaning they can be declared to-be-closed. __close calls lane:join(nil).

- If a lane body pulls a C function or userdata exposed by a module required before Lanes itself (thus not through a hooked require()), the lane generator creation will raise an error. - The name in the message is a path where it was found by scanning _G and the registry. As a utility, the name guessing functionality is exposed as such: + If a lane body pulls a C function or userdata exposed by a module required before Lanes itself (thus not through a hooked require()), the lane generator creation will raise an error. + The name in the message is a path where it was found by scanning _G and the registry. As a utility, the name guessing functionality is exposed as such: @@ -938,7 +943,7 @@

Coroutine lanes

- It is possible to have the lane body run inside the lane as a coroutine. For this, just use lanes.coro() instead of lanes.gen(). + It is possible to have the lane body run inside the lane as a coroutine. For this, just use lanes.coro() instead of lanes.gen().

@@ -948,9 +953,9 @@
- Coroutine lanes operate mostly like regular coroutines. They can use coroutine.yield() normally.
- A yielded coroutine lane has a "suspended" status. It can be resumed with lane_h:resume(values...), which returns the yielded values. - The latter can also be the returned values of lane_h:join() or accessed by regular lane indexing (see Results and errors).
+ Coroutine lanes operate mostly like regular coroutines. They can use coroutine.yield() normally.
+ A yielded coroutine lane has a "suspended" status. It can be resumed with lane_h:resume(values...), which returns the yielded values. + The latter can also be the returned values of lane_h:join() or accessed by regular lane indexing (see Results and errors).
@@ -959,8 +964,8 @@
- Just like regular coroutines, the reply values passed to h:resume() are returned to the lane body at the coroutine.yield() point.
- If a coroutine lane is suspended when it is joined either by indexing or lane_h:join(), active to-be-closed variables are closed at that point, and the Lane can no longer be resumed. + Just like regular coroutines, the reply values passed to h:resume() are returned to the lane body at the coroutine.yield() point.
+ If a coroutine lane is suspended when it is joined either by indexing or lane_h:join(), active to-be-closed variables are closed at that point, and the Lane can no longer be resumed.

Free running lanes

@@ -994,9 +999,9 @@

Besides setting a default priority in the generator settings, each thread can change its own priority at will. This is also true for the main Lua state.
- lanes.thread_priority_range() returns the range of acceptable mapped values. If nothing is specified, should be [-3,3] or [0,3], depending on the threading implementation. + lanes.thread_priority_range() returns the range of acceptable mapped values. If nothing is specified, should be [-3,3] or [0,3], depending on the threading implementation.
- lanes.thread_priority_range('native') returns the range of acceptable native values. The actual values are threading implementation dependent. And some implementations can only accept some values inside that range. YMMV. + lanes.thread_priority_range('native') returns the range of acceptable native values. The actual values are threading implementation dependent. And some implementations can only accept some values inside that range. YMMV.

@@ -1028,7 +1033,7 @@

- Read back the value set during lane generation, one of "basic", "minimal", "extended". + Read back the value set during lane generation, one of "basic", "minimal", "extended".

@@ -1044,103 +1049,89 @@

- The current execution state of a lane can be read via its status member, providing one of these values: + The current execution state of a lane can be read via its status member, providing one of these values: - +
+ + + + - - - - - - - - - - - - - - - - - - @@ -1149,7 +1140,7 @@

- This is similar to coroutine.status, which has: "running" / "suspended" / "normal" / "dead". Not using the exact same names is intentional. + This is similar to coroutine.status, which has: "running" / "suspended" / "normal" / "dead". Not using the exact same names is intentional.

@@ -1166,9 +1157,9 @@
namedefinition
- "pending" + "pending" Not started yet. Shouldn't stay very long in that state.
- + "running" - + - Running, not suspended on a linda call, or yielded on a coroutine.yield() call. + Running, not suspended on a linda call, or yielded on a coroutine.yield() call.
- + "suspended" - + - Coroutine lane stopped at a coroutine.yield() point. + Coroutine lane stopped at a coroutine.yield() point.
- + "resuming" - + - Parent state called lane_h:resume() on a suspended coroutine lane, but the lane hasn't yet actually resumed execution. + Parent state called lane_h:resume() on a suspended coroutine lane, but the lane hasn't yet actually resumed execution.
- + "closing" - + - Happens only inside a join()/indexation call to unblock a suspended coroutine lane so that it can join properly. In theory not observable by lanes client code, but who knows. + Happens only inside a join()/indexation call to unblock a suspended coroutine lane so that it can join properly. In theory not observable by lanes client code, but who knows.
- "waiting" + "waiting" - Waiting at a linda :receive() or :send(). + Waiting at a linda :receive() or :send().
- "done" + "done" Finished executing (results are ready).
- "error" + "error" Met an error (reading results will propagate it).
- "cancelled" + "cancelled" Received cancellation and finished itself.

- Only available if lane tracking is enabled by setting track_lanes. + Only available if lane tracking is enabled by setting track_lanes.
- Returns an array table where each entry is a table containing a lane's name and status. Returns nil if no lane is running. + Returns an array table where each entry is a table containing a lane's name and status. Returns nil if no lane is running.

@@ -1189,7 +1180,7 @@

- Makes sure lane has finished or yielded, and gives its first (maybe only) return value. Other return values will be available in other lane_h indices. + Makes sure lane has finished or yielded, and gives its first (maybe only) return value. Other return values will be available in other lane_h indices.
If the lane ended in an error, it is propagated to master state at this place.

@@ -1199,23 +1190,23 @@

- Waits until the lane finishes/yields, or timeout seconds have passed (forever if nil).
+ Waits until the lane finishes/yields, or timeout seconds have passed (forever if nil).
Unlike in reading the results in table fashion, errors are not propagated.
Possible return values are:

- If the lane handle obtained from lanes.gen() is to-be-closed, closing the value will cause a call to join(). + If the lane handle obtained from lanes.gen() is to-be-closed, closing the value will cause a call to join().

@@ -1259,51 +1250,51 @@
 

- cancel() sends a cancellation request to the lane. + cancel() sends a cancellation request to the lane.

- Returns true, lane_h.status if lane was already done (in "done", "error" or "cancelled" status), or the cancellation was fruitful within timeout_secs timeout period.
- Returns false, "timeout" otherwise. + Returns true, lane_h.status if lane was already done (in "done", "error" or "cancelled" status), or the cancellation was fruitful within timeout_secs timeout period.
+ Returns false, "timeout" otherwise.

- First argument is a mode. It can be one of: + First argument is a mode. It can be one of:

- If mode is not specified, it defaults to "hard". + If mode is not specified, it defaults to "hard".

- If wake_lane is true, the lane is also signalled so that execution returns from any pending linda operation. linda operations detecting the cancellation request return lanes.cancel_error. + If wake_lane is true, the lane is also signalled so that execution returns from any pending linda operation. linda operations detecting the cancellation request return lanes.cancel_error.

- timeout is an optional number >= 0. Defaults to infinite if left unspecified or nil. + timeout is an optional number >= 0. Defaults to infinite if left unspecified or nil.

If the lane is still running after the timeout expired, there is a chance Lanes will freeze forever at shutdown when failing to terminate all free-running lanes within the specified timeout.

- Cancellation is tested before going to sleep in receive(), receive_batched() or send() calls and after executing cancelstep Lua statements. A pending receive()or send() call is awakened. + Cancellation is tested before going to sleep in receive(), receive_batched() or send() calls and after executing cancelstep Lua statements. A pending receive()or send() call is awakened.
This means the execution of the lane will resume although the operation has not completed, to give the lane a chance to detect cancellation (even in the case the code waits on a linda with infinite timeout).
@@ -1315,10 +1306,10 @@ false|"soft"|"hard" = cancel_test(true) -- returns "hard" instead of raising

- Lanes installs the function cancel_test() in each created lane to manually test for cancel requests. - It returns false when no cancel is pending, "soft" on a soft cancel request, and raises - lanes.cancel_error on a hard cancel request. Passing true as the optional argument suppresses - the raise and returns "hard" instead, which is useful when the lane needs to distinguish the cancel + Lanes installs the function cancel_test() in each created lane to manually test for cancel requests. + It returns false when no cancel is pending, "soft" on a soft cancel request, and raises + lanes.cancel_error on a hard cancel request. Passing true as the optional argument suppresses + the raise and returns "hard" instead, which is useful when the lane needs to distinguish the cancel mode before deciding how to react.

@@ -1333,12 +1324,12 @@

- The regular Lua error function is usable in lanes for throwing exceptions. What Lua does not offer, however, is scoped finalizers - that would get called when a certain block of instructions gets exited, whether through peaceful return or abrupt error. + The regular Lua error function is usable in lanes for throwing exceptions. What Lua does not offer, however, is scoped finalizers + that would get called when a certain block of instructions gets exited, whether through peaceful return or abrupt error.

- Lanes registers a function set_finalizer() in the lane's Lua state for doing this. + Lanes registers a function set_finalizer() in the lane's Lua state for doing this. Any functions given to it will be called in the lane's Lua state, just prior to closing it. It is possible to set more than one finalizer. They are called in LIFO order.

@@ -1413,23 +1404,23 @@
  • Values can be any type supported by inter-state copying (same limits as for function arguments and upvalues).
  • Registered functions and userdata transiting into a Keeper state are converted to a special dummy closure that holds its actual identity. On transit out, the identity is used to find the real function or userdata in the destination. - For that reason, it is not possible to run user code inside a Keeper state. The only exception is on_state_create, which is handled in a special way. + For that reason, it is not possible to run user code inside a Keeper state. The only exception is on_state_create, which is handled in a special way.
  • -
  • Consuming method is :receive() (not in).
  • -
  • Non-consuming method is :get() (not rd).
  • -
  • Two producer-side methods: :send() and :set() (not out).
  • -
  • send() allows for sending multiple values -atomically- to a given slot.
  • -
  • receive() can wait for multiple slots at once.
  • -
  • receive_batched() can be used to consume more than one value from a single slot, as in linda:receive_batched(1.0, "slot", 3, 6).
  • -
  • restrict() can restrain a particular slot to function either with send()/receive() or set()/get().
  • -
  • Individual slots' queue length can be limited, balancing speed differences in a producer/consumer scenario (making :send() wait).
  • -
  • tostring(linda) returns a string of the form "Linda: <opt_name>"
  • +
  • Consuming method is :receive() (not in).
  • +
  • Non-consuming method is :get() (not rd).
  • +
  • Two producer-side methods: :send() and :set() (not out).
  • +
  • send() allows for sending multiple values -atomically- to a given slot.
  • +
  • receive() can wait for multiple slots at once.
  • +
  • receive_batched() can be used to consume more than one value from a single slot, as in linda:receive_batched(1.0, "slot", 3, 6).
  • +
  • restrict() can restrain a particular slot to function either with send()/receive() or set()/get().
  • +
  • Individual slots' queue length can be limited, balancing speed differences in a producer/consumer scenario (making :send() wait).
  • +
  • tostring(linda) returns a string of the form "Linda: <opt_name>"
  • - Several linda objects may share the same Keeper state. In case there is more than one user Keeper state, assignation must be controlled with the linda's group (an integer in [0,nb_user_keepers]). - Lanes has an internal linda used for timers and lanes.wait(); this linda uses group 0. + Several linda objects may share the same Keeper state. In case there is more than one user Keeper state, assignation must be controlled with the linda's group (an integer in [0,nb_user_keepers]). + Lanes has an internal linda used for timers and lanes.wait(); this linda uses group 0.
  • - IMPORTANT: *all* linda operations are wrapped inside a lua_gc STOP/RESTART pair. + IMPORTANT: *all* linda operations are wrapped inside a lua_gc STOP/RESTART pair. This is to prevent potential collection of a linda during another linda's operation, as this can cause a crash if they are bound to the same Keeper state.
  • @@ -1440,17 +1431,17 @@

    - Argument to lanes.linda() is either nil or a single table. The table may contain the following entries: + Argument to lanes.linda() is either nil or a single table. The table may contain the following entries:

    Unknown fields are silently ignored. @@ -1462,12 +1453,12 @@

    - By default, queue sizes are unlimited but limits can be enforced using the limit() method. This can be useful to balance execution speeds in a producer/consumer scenario.
    - A limit of 0 is allowed to block everything. "unlimited" removes the limit.
    - If the slot was full but the limit change added some room, limit() first return value is true and the linda is signalled so that send()-blocked threads are awakened, else the return value is false. - If no limit is provided, limit() first return value is the current limit for the specified slot.
    - The second returned value is a string representing the fill status relatively to the slot's current limit (one of "over", "under", "exact"). - Whether reading or writing, if the linda is cancelled, limit() returns nil, lanes.cancel_error. + By default, queue sizes are unlimited but limits can be enforced using the limit() method. This can be useful to balance execution speeds in a producer/consumer scenario.
    + A limit of 0 is allowed to block everything. "unlimited" removes the limit.
    + If the slot was full but the limit change added some room, limit() first return value is true and the linda is signalled so that send()-blocked threads are awakened, else the return value is false. + If no limit is provided, limit() first return value is the current limit for the specified slot.
    + The second returned value is a string representing the fill status relatively to the slot's current limit (one of "over", "under", "exact"). + Whether reading or writing, if the linda is cancelled, limit() returns nil, lanes.cancel_error.

    @@ -1476,12 +1467,12 @@
     

    - It is possible to restrict a particular slot in a Linda to either send()/receive() or set()/get() operations.
    - Possible modes are "none", "set/get" or "send/receive".
    - If a new mode is specified, restrict() updates the mode and returns the previous one.
    - If no mode is specified, restrict() does nothing and returns the current mode.
    - If the linda is cancelled, restrict() returns nil, lanes.cancel_error.
    - If an unknown mode is specified, restrict() raises an error. + It is possible to restrict a particular slot in a Linda to either send()/receive() or set()/get() operations.
    + Possible modes are "none", "set/get" or "send/receive".
    + If a new mode is specified, restrict() updates the mode and returns the previous one.
    + If no mode is specified, restrict() does nothing and returns the current mode.
    + If the linda is cancelled, restrict() returns nil, lanes.cancel_error.
    + If an unknown mode is specified, restrict() raises an error.

    @@ -1489,7 +1480,7 @@
     

    - Timeouts are given in seconds (>= 0, millisecond accuracy) or nil. Timeout can be omitted only if the first slot is not a number (then it is equivalent to an infinite duration).
    + Timeouts are given in seconds (>= 0, millisecond accuracy) or nil. Timeout can be omitted only if the first slot is not a number (then it is equivalent to an infinite duration).
    Each slot acts as a FIFO queue. There is no limit to the number of slots a linda may contain. Different lindas can have identical slots, which are totally unrelated.

    @@ -1499,18 +1490,18 @@

    - If linda.null or lanes.null is sent as data in a linda, it will be read as a nil.
    + If linda.null or lanes.null is sent as data in a linda, it will be read as a nil.

    - send() raises an error if no data is provided after the slot.
    - send() raises an error if called when a restriction forbids its use on the provided slot.
    - send() raises lanes.cancel_error if interrupted by a hard cancel request.
    - send() return values can be: + send() raises an error if no data is provided after the slot.
    + send() raises an error if called when a restriction forbids its use on the provided slot.
    + send() raises lanes.cancel_error if interrupted by a hard cancel request.
    + send() return values can be:

    @@ -1521,16 +1512,16 @@

    - receive() and receive_batched() raise an error if called when a restriction forbids their use on any provided slot.
    - receive_batched() will raise an error if min_count < 1 or max_count < min_count. + receive() and receive_batched() raise an error if called when a restriction forbids their use on any provided slot.
    + receive_batched() will raise an error if min_count < 1 or max_count < min_count.

    - Unbatched receive() return values can be: + Unbatched receive() return values can be:

    @@ -1553,29 +1544,29 @@

    - set() and get() raise an error if used when a restriction forbids their use on the provided slot.
    - Unless a particular slot is constrained with restrict(), get()/set() and send()/receive() can be used together; reading a slot essentially peeks the next outcoming value of a queue.
    - get()/set() are for accessing a slot without queuing or consuming. They can be used for making shared tables of storage among the lanes.
    - set() never blocks because it ignores the limit. It overwrites existing values and clears any possible queued entries.
    + set() and get() raise an error if used when a restriction forbids their use on the provided slot.
    + Unless a particular slot is constrained with restrict(), get()/set() and send()/receive() can be used together; reading a slot essentially peeks the next outcoming value of a queue.
    + get()/set() are for accessing a slot without queuing or consuming. They can be used for making shared tables of storage among the lanes.
    + set() never blocks because it ignores the limit. It overwrites existing values and clears any possible queued entries.

    - get() can read several values at once, and does not block. Return values ares: + get() can read several values at once, and does not block. Return values ares:

    - set() can write several values at the specified slot. Writing nil values is possible, and clearing the contents at the specified slot is done by not providing any value.
    - If set() actually stores data, the linda is signalled for write, so that receive()-blocked Lanes are awakened.
    + set() can write several values at the specified slot. Writing nil values is possible, and clearing the contents at the specified slot is done by not providing any value.
    + If set() actually stores data, the linda is signalled for write, so that receive()-blocked Lanes are awakened.
    Clearing the contents of a non-existent slot does not create it!
    - If the slot was full but the new data count of the slot after set() is below its limit, set() first return value is true and the linda is also signaled for read, so that send()-blocked Lanes are awakened.
    - If the slot was not already full, nothing additional happens, and set() first return value is false.
    - The second return value is a string representing the fill status relatively to the slot's current limit (one of "over", "under", "exact"). + If the slot was full but the new data count of the slot after set() is below its limit, set() first return value is true and the linda is also signaled for read, so that send()-blocked Lanes are awakened.
    + If the slot was not already full, nothing additional happens, and set() first return value is false.
    + The second return value is a string representing the fill status relatively to the slot's current limit (one of "over", "under", "exact").

    - Trying to send or receive data through a cancelled linda does nothing and returns lanes.cancel_error. + Trying to send or receive data through a cancelled linda does nothing and returns lanes.cancel_error.

    @@ -1583,7 +1574,7 @@
     

    - Forces a full garbage collect cycle inside the Keeper state assigned to the linda (same as lua_gc(L, LUA_GCCOLLECT)).
    + Forces a full garbage collect cycle inside the Keeper state assigned to the linda (same as lua_gc(L, LUA_GCCOLLECT)).
    All lindas sharing the same Keeper state will have to wait for the operation to complete before being able to resume regular service.
    Can be useful to clean stale storage after some keys are cleaned.

    @@ -1616,8 +1607,8 @@

    - Returns a table describing the full contents of a linda, or nil if the linda wasn't used yet.
    - If Decoda support is enabled with HAVE_DECODA_SUPPORT(), the linda metatable contains a __towatch special function that generates a similar table used for debug display. + Returns a table describing the full contents of a linda, or nil if the linda wasn't used yet.
    + If Decoda support is enabled with HAVE_DECODA_SUPPORT(), the linda metatable contains a __towatch special function that generates a similar table used for debug display.

    @@ -1626,10 +1617,10 @@
     

    - linda:cancel() signals the linda so that lanes waiting for read, write, or both, wake up. - All linda operations (including get() and set()) will return lanes.cancel_error as when the calling lane is soft-cancelled as long as the linda is marked as cancelled.
    - "none" reset the linda's cancel status, but doesn't signal it.
    - linda.status reads the current cancel status. + linda:cancel() signals the linda so that lanes waiting for read, write, or both, wake up. + All linda operations (including get() and set()) will return lanes.cancel_error as when the calling lane is soft-cancelled as long as the linda is marked as cancelled.
    + "none" reset the linda's cancel status, but doesn't signal it.
    + linda.status reads the current cancel status. If not void, the lane's cancel status overrides the linda's cancel status.

    @@ -1658,7 +1649,7 @@ Whenever Lua code reads from or writes to a linda, the mutex is acquired. If linda limits don't block the operation, it is fulfilled, then the mutex is released.
    If the linda has to block, the mutex is released and the OS thread sleeps, waiting for a linda operation to be signalled. When an operation occurs on the same linda, possibly fufilling the condition, or a timeout expires, the thread wakes up.
    If the thread is woken but the condition is not yet fulfilled, it goes back to sleep, until the timeout expires.
    - When a lane is cancelled, the signal it is waiting on (if any) is signalled. In that case, the linda operation will return lanes.cancel_error.
    + When a lane is cancelled, the signal it is waiting on (if any) is signalled. In that case, the linda operation will return lanes.cancel_error.

    @@ -1679,7 +1670,7 @@

  • Performance. Changing any slot in a linda causes all pending threads for that linda to be momentarily awakened (at least in the C level). - This can degrade performance due to unnecessary OS level context switches. The more Keeper states you declared with lanes.configure() the less this should be a problem. + This can degrade performance due to unnecessary OS level context switches. The more Keeper states you declared with lanes.configure() the less this should be a problem.
  • @@ -1700,19 +1691,19 @@

    - Timers are implemented as a lane. They can be enabled by setting "with_timers" to true in lanes.configure() settings. + Timers are implemented as a lane. They can be enabled by setting "with_timers" to true in lanes.configure() settings.

    - Timers can be run once, or in a reoccurring fashion (period_secs > 0). The first occurrence can be given either as a date or as a relative delay in seconds. The date table is like what os.date("*t") returns, in the local time zone. + Timers can be run once, or in a reoccurring fashion (period_secs > 0). The first occurrence can be given either as a date or as a relative delay in seconds. The date table is like what os.date("*t") returns, in the local time zone.

    - Once a timer expires, the slot is set with the current time (in seconds, same offset as os.time() but with millisecond accuracy). The slot can be waited upon using the regular linda:receive() method. + Once a timer expires, the slot is set with the current time (in seconds, same offset as os.time() but with millisecond accuracy). The slot can be waited upon using the regular linda:receive() method.

    - A timer can be stopped simply with first_secs=0|nil and no period. + A timer can be stopped simply with first_secs=0|nil and no period.

    @@ -1738,25 +1729,25 @@
     	end
     
    -

    - NOTE: Timer slots are set, not queued, so missing a beat is possible especially if the timer cycle is extremely small. The slot value can be used to know the actual time passed. -

    +

    - + + + + +
    Design note:NOTE:Timer slots are set, not queued, so missing a beat is possible especially if the timer cycle is extremely small. The slot value can be used to know the actual time passed.
    Design note: - - Having the API as lanes.timer() is intentional. Another alternative would be linda_h:timer() but timers are not traditionally seen to be part of lindas. Also, it would mean any lane getting a linda handle would be able to modify timers on it. - A third choice could be abstracting the timers out of linda realm altogether (timer_h = lanes.timer(date|first_secs, period_secs )) but that would mean separate waiting functions for timers, and lindas. + Having the API as lanes.timer() is intentional. Another alternative would be linda_h:timer() but timers are not traditionally seen to be part of lindas. Also, it would mean any lane getting a linda handle would be able to modify timers on it. + A third choice could be abstracting the timers out of linda realm altogether (timer_h = lanes.timer(date|first_secs, period_secs )) but that would mean separate waiting functions for timers, and lindas. Even if a linda object and slot was returned, that slot couldn't be waited upon simultaneously with one's general linda events. The current system gives maximum capabilities with minimum API, and any smoothenings can easily be crafted in Lua at the application level. -
    -

    +

     	{[{linda, slot, {when [, period]}}[,...]]} = lanes.timers()
    @@ -1764,7 +1755,7 @@
     
     

    The full list of active timers can be obtained. Obviously, this is a snapshot, and non-repeating timers might no longer exist by the time the results are inspected.
    - Can return nil, "timeout" or nil, lanes.cancel_error in case of interruption. + Can return nil, "timeout" or nil, lanes.cancel_error in case of interruption.

    @@ -1773,8 +1764,8 @@
     
     

    A very simple way of sleeping when nothing else is available. Is implemented by attempting to read some data in an unused channel of the internal linda used for timers (this linda exists even when timers aren't enabled). - Passing nil or no argument sleeps indefinitely (until cancellation is received). Passing a non-negative number sleeps for that many seconds.
    - Return values should always be nil, "timeout" (or nil, lanes.cancel_error in case of interruption). + Passing nil or no argument sleeps indefinitely (until cancellation is received). Passing a non-negative number sleeps for that many seconds.
    + Return values should always be nil, "timeout" (or nil, lanes.cancel_error in case of interruption).

    @@ -1790,7 +1781,7 @@
     

    Locks etc.

    - Lanes does not generally require locks or critical sections to be used, at all. If necessary, a limited queue can be used to emulate them. lanes.lua offers some sugar to make it easy: + Lanes does not generally require locks or critical sections to be used, at all. If necessary, a limited queue can be used to emulate them. lanes.lua offers some sugar to make it easy:

    @@ -1802,11 +1793,11 @@
     

    - The generated function acquires M tokens from the N available, or releases them if the value is negative. The acquiring call will suspend the lane, if necessary. Use M=N=1 for a critical section lock (only one lane allowed to enter). + The generated function acquires M tokens from the N available, or releases them if the value is negative. The acquiring call will suspend the lane, if necessary. Use M=N=1 for a critical section lock (only one lane allowed to enter).
    - When passing "try" as second argument when acquiring, then lock_func operates on the linda with a timeout of 0 to emulate a TryLock() operation. If locking fails, lock_func returns false. "try" is ignored when releasing (as it it not expected to ever have to wait unless the acquisition/release pairs are not properly matched). + When passing "try" as second argument when acquiring, then lock_func operates on the linda with a timeout of 0 to emulate a TryLock() operation. If locking fails, lock_func returns false. "try" is ignored when releasing (as it it not expected to ever have to wait unless the acquisition/release pairs are not properly matched).
    - Upon successful lock/unlock, lock_func returns true (always the case when block-waiting for completion). + Upon successful lock/unlock, lock_func returns true (always the case when block-waiting for completion).

    @@ -1826,7 +1817,7 @@

    - Each time called, the generated function will change linda[slot] atomically, without other lanes being able to interfere. The new value is returned. You can use either diff 0.0 or get to just read the current value. + Each time called, the generated function will change linda[slot] atomically, without other lanes being able to interfere. The new value is returned. You can use either diff 0.0 or get to just read the current value.

    @@ -1851,14 +1842,14 @@ Using the same source table in multiple linda messages keeps no ties between the tables (this is the same reason why tables can't be used as slots).

  • - For tables and full userdata that are neither deep nor clonable: before anything else, a converter is searched for in the __lanesconvert field of its metatable. - If there is no metatable, or no __lanesconvert, convert_fallback is used instead. + For tables and full userdata that are neither deep nor clonable: before anything else, a converter is searched for in the __lanesconvert field of its metatable. + If there is no metatable, or no __lanesconvert, convert_fallback is used instead. The source object is then converted depending on the converter value:
      -
    • nil: The value is not converted. If it is not a clonable or deep userdata, the transfer will eventually fail with an error.
    • -
    • lanes.null: The value is converted to nil.
    • -
    • "decay": The value is converted to a light userdata obtained from lua_topointer().
    • -
    • A function: The function is called as o:__lanesconvert(string), where the argument is either "keeper" (sending data in a Linda) or "regular" (when creating or calling a Lane generator). Its first return value is the result of the conversion, the rest is ignored. Transfer is then attempted on the new value. If this also requires a conversion, it will be done, up to a count of convert_max_attempts, after which an error will be raised.
    • +
    • nil: The value is not converted. If it is not a clonable or deep userdata, the transfer will eventually fail with an error.
    • +
    • lanes.null: The value is converted to nil.
    • +
    • "decay": The value is converted to a light userdata obtained from lua_topointer().
    • +
    • A function: The function is called as o:__lanesconvert(string), where the argument is either "keeper" (sending data in a Linda) or "regular" (when creating or calling a Lane generator). Its first return value is the result of the conversion, the rest is ignored. Transfer is then attempted on the new value. If this also requires a conversion, it will be done, up to a count of convert_max_attempts, after which an error will be raised.
    • Any other value raises an error.
  • @@ -1869,10 +1860,10 @@ Objects (tables with a metatable) are copyable between lanes. Metatables are assumed to be immutable; they are internally indexed and only copied once per each type of objects per lane.
  • - C functions (lua_CFunction) referring to LUA_ENVIRONINDEX or LUA_REGISTRYINDEX might not do what you expect in the target, since they will actually use a different environment. + C functions (lua_CFunction) referring to LUA_ENVIRONINDEX or LUA_REGISTRYINDEX might not do what you expect in the target, since they will actually use a different environment.
  • - Lua 5.2 functions may have a special _ENV upvalue if they perform 'global namespace' lookups. Unless special care is taken, this upvalue defaults to the table found at LUA_RIDX_GLOBALS. + Lua 5.2 functions may have a special _ENV upvalue if they perform 'global namespace' lookups. Unless special care is taken, this upvalue defaults to the table found at LUA_RIDX_GLOBALS. Obviously, we don't want to transfer the whole global table along with each Lua function. Therefore, any upvalue equal to the global table is not transfered by value, but simply bound to the global table in the destination state. Note that this also applies when Lanes is built for Lua 5.1, as it doesn't hurt.
  • @@ -1904,9 +1895,9 @@

    Since functions and full userdata are first class values, they don't have a name. All we know for sure is that when a C module registers some functions or full userdata, they are accessible to the script that required the module through some exposed variables.
    - For example, loading the string base library creates a table accessible when indexing the global environment with key "string". Indexing this table with "match", "gsub", etc. will give us a function. + For example, loading the string base library creates a table accessible when indexing the global environment with key "string". Indexing this table with "match", "gsub", etc. will give us a function.
    - Similarly, loading the io base library creates a table accessible when indexing the global environment with key "io". Indexing this table with "open", will give us a function, and "stdin" will give us a full userdata. + Similarly, loading the io base library creates a table accessible when indexing the global environment with key "io". Indexing this table with "open", will give us a function, and "stdin" will give us a full userdata.
    When a lane generator creates a lane and performs initializations described by the list of base libraries and the list of required modules, it recursively scans the table created by the initialisation of the module, looking for all values that are C functions and full userdata.
    @@ -1914,25 +1905,25 @@
    Then, when a function or full userdata is transfered from one state to another, all we have to do is retrieve the name associated to this value in the source Lua state, then with that name retrieve the equivalent value that already exists in the destination state.
    - Note that there is no need to transfer upvalues/uservalues, as they are already bound to the value registered in the destination state. (And in any event, it is not possible to create a closure from a C function pushed on the stack, it can only be created with a lua_CFunction pointer). + Note that there is no need to transfer upvalues/uservalues, as they are already bound to the value registered in the destination state. (And in any event, it is not possible to create a closure from a C function pushed on the stack, it can only be created with a lua_CFunction pointer).

    There are several issues here:

    • - Some base libraries register some C functions in the global environment. Because of that, Lanes must scan the global namespace to find all C functions (such as error, print, require, etc.).
      - This happens a single time, when lanes.configure() is called. Therefore, if some base libraries are not loaded before that point, it will not be possible to send values that reference stuff they offer unless they are manually registered with lanes.register(). + Some base libraries register some C functions in the global environment. Because of that, Lanes must scan the global namespace to find all C functions (such as error, print, require, etc.).
      + This happens a single time, when lanes.configure() is called. Therefore, if some base libraries are not loaded before that point, it will not be possible to send values that reference stuff they offer unless they are manually registered with lanes.register().
    • Nothing prevents a script to create other references to a C function or full userdata. For example one could do
       				string2 = string
       			
      - When iterating over all keys of the global table, Lanes has no guarantee that it will hit "string" before or after "string2". However, the values associated to string.match and string2.match are the same C function. + When iterating over all keys of the global table, Lanes has no guarantee that it will hit "string" before or after "string2". However, the values associated to string.match and string2.match are the same C function. Lanes doesn't normally expect a C function or full userdata value to be encountered more than once. In the event it occurs, the shortest name that was computed is retained. - If Lanes processed "string2" first, it means that if the Lua state that contains the "string2" global name sends function string.match, lookup_func_name would return name "string2.match", with the obvious effect that push_resolved_func - won't find "string2.match" in the destination lookup database, thus failing the transfer (even though this function exists, but is referenced under name "string.match"). + If Lanes processed "string2" first, it means that if the Lua state that contains the "string2" global name sends function string.match, lookup_func_name would return name "string2.match", with the obvious effect that push_resolved_func + won't find "string2.match" in the destination lookup database, thus failing the transfer (even though this function exists, but is referenced under name "string.match").
    • Lua 5.2 introduced a hash randomizer seed which causes table iteration to yield a different key order on different VMs even when the tables are populated the exact same way. @@ -1944,14 +1935,14 @@
    Another more immediate reason of failed transfer is when the destination state doesn't know about the C function or full userdata that has to be transferred. This occurs if a value is transferred in a lane before it had a chance to scan the module that exposed it. If the C function or full userdata is sent through a linda, it is sufficient for the destination lane body to have required the module before the function is sent. - But if the lane body provided to the generator has a C function or full userdata as upvalue, the transfer itself must succeed, therefore the module that exposed that C function or full userdata must be required in the destination lane before the lane body starts executing. This is where the .required options play their role. + But if the lane body provided to the generator has a C function or full userdata as upvalue, the transfer itself must succeed, therefore the module that exposed that C function or full userdata must be required in the destination lane before the lane body starts executing. This is where the .required options play their role.

    Required of module makers

    - Most Lua extension modules should work unaltered with Lanes. If the module simply ties C side features to Lua, everything is fine without alterations. The luaopen_...() entry point will be called separately for each lane, where the module is require'd from. + Most Lua extension modules should work unaltered with Lanes. If the module simply ties C side features to Lua, everything is fine without alterations. The luaopen_...() entry point will be called separately for each lane, where the module is require'd from.

    @@ -1974,9 +1965,9 @@

    Clonable full userdata in your own apps

    - An alternative way of passing full userdata across lanes uses a new __lanesclone metamethod. - When a deep userdata is cloned, Lanes calls __lanesclone once, in the context of the source lane.
    - The call receives the clone and original as light userdata, plus the actual userdata size, as in clone:__lanesclone(original,size), and should perform the actual cloning.
    + An alternative way of passing full userdata across lanes uses a new __lanesclone metamethod. + When a deep userdata is cloned, Lanes calls __lanesclone once, in the context of the source lane.
    + The call receives the clone and original as light userdata, plus the actual userdata size, as in clone:__lanesclone(original,size), and should perform the actual cloning.
    A typical implementation would look like:
     static int clonable_lanesclone(lua_State* L)
    @@ -2002,7 +1993,7 @@ static int clonable_lanesclone(lua_State* L)
     
     

    NOTE: In the event the source userdata has uservalues, it is not necessary to create them for the clone, Lanes will handle their cloning.
    - Of course, more complex objects may require smarter cloning behavior than a simple memcpy. Also, the module initialisation code should make each metatable accessible from the module table itself as in: + Of course, more complex objects may require smarter cloning behavior than a simple memcpy. Also, the module initialisation code should make each metatable accessible from the module table itself as in:
     int luaopen_deep_userdata_example(lua_State* L)
     {
    @@ -2029,7 +2020,7 @@ int luaopen_deep_userdata_example(lua_State* L)
     

    - Then a new clonable userdata instance can just do like any non-Lanes aware userdata, as long as its metatable contains the aforementionned __lanesclone method. + Then a new clonable userdata instance can just do like any non-Lanes aware userdata, as long as its metatable contains the aforementionned __lanesclone method.
     int luaD_new_clonable(lua_State* L)
     {
    @@ -2063,30 +2054,30 @@ class MyDeepFactory : public DeepFactory
     static MyDeepFactory g_MyDeepFactory;
     

      -
    • newDeepObjectInternal(): requests the creation of a new object, whose pointer is returned. Said object must derive from DeepPrelude.
    • -
    • deleteDeepObjectInternal(): should cleanup the object.
    • -
    • createMetatable(): should build a metatable for the object. Don't cache the metatable yourself, Lanes takes care of it (createMetatable should only be invoked once per state). Just push the metatable on the stack.
    • -
    • moduleName(): requests the name of the module that exports the factory, to be returned. It is necessary so that Lanes can require it in any lane state that receives a userdata. This is to prevent crashes in situations where the module could be unloaded while the factory pointer is still held.
    • +
    • newDeepObjectInternal(): requests the creation of a new object, whose pointer is returned. Said object must derive from DeepPrelude.
    • +
    • deleteDeepObjectInternal(): should cleanup the object.
    • +
    • createMetatable(): should build a metatable for the object. Don't cache the metatable yourself, Lanes takes care of it (createMetatable should only be invoked once per state). Just push the metatable on the stack.
    • +
    • moduleName(): requests the name of the module that exports the factory, to be returned. It is necessary so that Lanes can require it in any lane state that receives a userdata. This is to prevent crashes in situations where the module could be unloaded while the factory pointer is still held.
    - Take a look at LindaFactory in lindafactory.cpp or MyDeepFactory in deep_userdata_example.cpp. + Take a look at LindaFactory in lindafactory.cpp or MyDeepFactory in deep_userdata_example.cpp. -
  • Include "_pch.hpp", "deep.hpp" and either link against Lanes or statically compile compat.cpp deep.cpp into your module if you want to avoid a runtime dependency for users that will use your module without Lanes. -
  • Instanciate your userdata using yourFactoryObject.pushDeepUserdata(), instead of the regular lua_newuserdata(). Given a factory, it sets up the support structures and returns a state-specific proxy full userdata for accessing your data. This proxy can also be copied over to other lanes.
  • -
  • Accessing the deep userdata from your C code, use yourFactoryObject.toDeep() instead of the regular lua_touserdata().
  • -
  • To push an existing proxy on the stack, use DeepPrelude::push(L).
  • +
  • Include "_pch.hpp", "deep.hpp" and either link against Lanes or statically compile compat.cpp deep.cpp into your module if you want to avoid a runtime dependency for users that will use your module without Lanes. +
  • Instanciate your userdata using yourFactoryObject.pushDeepUserdata(), instead of the regular lua_newuserdata(). Given a factory, it sets up the support structures and returns a state-specific proxy full userdata for accessing your data. This proxy can also be copied over to other lanes.
  • +
  • Accessing the deep userdata from your C code, use yourFactoryObject.toDeep() instead of the regular lua_touserdata().
  • +
  • To push an existing proxy on the stack, use DeepPrelude::push(L).
  • - Deep userdata management will take care of tying to __gc methods, and doing reference counting to see how many proxies are still there for accessing the data. Once there are none, the data will be freed through a call to the factory you provided. + Deep userdata management will take care of tying to __gc methods, and doing reference counting to see how many proxies are still there for accessing the data. Once there are none, the data will be freed through a call to the factory you provided.

    Pay attention to the fact a deep userdata last proxy can be held inside a Keeper state after being stored in a linda and all other references are lost. - If the linda then flushes its contents through garbage collection in the Keeper state or by being collected itself, it means that deleteDeepObjectInternal() can be called from inside a Keeper state. + If the linda then flushes its contents through garbage collection in the Keeper state or by being collected itself, it means that deleteDeepObjectInternal() can be called from inside a Keeper state.

    - NOTE: The lifespan of deep userdata may exceed that of the Lua state that created it. The allocation of the data storage should not be tied to the Lua state used. In other words, use new/delete, malloc()/free() or similar memory handling mechanism. + NOTE: The lifespan of deep userdata may exceed that of the Lua state that created it. The allocation of the data storage should not be tied to the Lua state used. In other words, use new/delete, malloc()/free() or similar memory handling mechanism.

    @@ -2104,7 +2095,7 @@ static MyDeepFactory g_MyDeepFactory;

    Beware with print and file output

    - In multithreaded scenarios, giving multiple arguments to print() or file:write() may cause them to be overlapped in the output, something like this: + In multithreaded scenarios, giving multiple arguments to print() or file:write() may cause them to be overlapped in the output, something like this:
     	A:  print(1, 2, 3, 4 )
    @@ -2128,9 +2119,9 @@ static MyDeepFactory g_MyDeepFactory;
     		
  • Data passing (arguments, upvalues, linda messages) is generally fast, doing two binary state-to-state copies (from source state to hidden state, hidden state to target state). Remember that not only the function you specify but also its upvalues, their upvalues, etc. etc. will get copied.
  • Lane startup is fast (1000's of lanes a second), depending on the number of standard libraries initialized. Initializing all standard libraries is about 3-4 times slower than having no standard libraries at all. If you throw in a lot of lanes per second, make sure you give them minimal necessary set of libraries.
  • Waiting lindas are woken up (and execute some hidden Lua code) each time any slot in the lindas they are waiting for are changed. This may give essential slow-down (not measured, just a gut feeling) if a lot of linda slots are used. Using separate lindas for logically separate issues will help (which is good practice anyhow).
  • -
  • linda objects are light. The memory footprint is two OS-level signalling objects (HANDLE or pthread_cond_t) for each, plus one C pointer for the proxies per each Lua state using the linda. Barely nothing.
  • -
  • Timers are light. You can probably expect timers up to 0.01 second resolution to be useful, but that is very system specific. All timers are merged into one main timer state (see timer.lua); no OS side timers are utilized.
  • -
  • If you are using a lot of linda objects, it may be useful to try having more of these Keeper states. By default, only one is used (see lanes.configure()).
  • +
  • linda objects are light. The memory footprint is two OS-level signalling objects (HANDLE or pthread_cond_t) for each, plus one C pointer for the proxies per each Lua state using the linda. Barely nothing.
  • +
  • Timers are light. You can probably expect timers up to 0.01 second resolution to be useful, but that is very system specific. All timers are merged into one main timer state (see timer.lua); no OS side timers are utilized.
  • +
  • If you are using a lot of linda objects, it may be useful to try having more of these Keeper states. By default, only one is used (see lanes.configure()).
  • @@ -2139,7 +2130,7 @@ static MyDeepFactory g_MyDeepFactory;

    Cancellation of lanes uses the Lua error mechanism with a special lightuserdata error sentinel. - If you use pcall in code that needs to be cancellable from the outside, the special error might not get through to Lanes, thus preventing the lane from being cleanly cancelled. + If you use pcall in code that needs to be cancellable from the outside, the special error might not get through to Lanes, thus preventing the lane from being cleanly cancelled. You should throw any lightuserdata error further.

    @@ -2148,7 +2139,7 @@ static MyDeepFactory g_MyDeepFactory;

    - The sentinel is exposed as lanes.cancel_error, if you wish to use its actual value. + The sentinel is exposed as lanes.cancel_error, if you wish to use its actual value.

    diff --git a/docs/lua.css b/docs/lua.css new file mode 100644 index 0000000..9013b44 --- /dev/null +++ b/docs/lua.css @@ -0,0 +1,162 @@ +html { + background-color: #F8F8F8 ; +} + +body { + background-color: #FFFFFF ; + color: #000000 ; + font-family: Helvetica, Arial, sans-serif ; + text-align: justify ; + line-height: 1.25 ; + margin: 16px auto ; + padding: 32px ; + border: solid #ccc 1px ; + border-radius: 20px ; + max-width: 70em ; + width: 90% ; +} + +h1, h2, h3, h4 { + color: #000080 ; + font-family: Verdana, Geneva, sans-serif ; + font-weight: normal ; + font-style: normal ; + text-align: left ; +} + +h1 { + font-size: 28pt ; +} + +h1 img { + vertical-align: text-bottom ; +} + +h2:before { + content: "\2756" ; + padding-right: 0.5em ; +} + +a { + text-decoration: none ; +} + +a:link { + color: #000080 ; +} + +a:link:hover, a:visited:hover { + background-color: #D0D0FF ; + color: #000080 ; + border-radius: 4px ; +} + +a:link:active, a:visited:active { + color: #FF0000 ; +} + +div.menubar { + padding-bottom: 0.5em ; +} + +p.menubar { + margin-left: 2.5em ; +} + +.menubar a:hover { + margin: -3px -3px -3px -3px ; + padding: 3px 3px 3px 3px ; + border-radius: 4px ; +} + +:target { + background-color: #F0F0F0 ; + margin: -8px ; + padding: 8px ; + border-radius: 8px ; + outline: none ; +} + +hr { + display: none ; +} + +table hr { + background-color: #a0a0a0 ; + color: #a0a0a0 ; + border: 0 ; + height: 1px ; + display: block ; +} + +.footer { + color: gray ; + font-size: x-small ; + text-transform: lowercase ; +} + +input[type=text] { + border: solid #a0a0a0 2px ; + border-radius: 2em ; + background-image: url('images/search.png') ; + background-repeat: no-repeat ; + background-position: 4px center ; + padding-left: 20px ; + height: 2em ; +} + +pre.session { + background-color: #F8F8F8 ; + padding: 1em ; + border-radius: 8px ; +} + +table { + border: none ; + border-spacing: 0 ; + border-collapse: collapse ; +} + +td { + padding: 0 ; + margin: 0 ; +} + +td.gutter { + width: 4% ; +} + +table.columns td { + vertical-align: top ; + padding-bottom: 1em ; + text-align: justify ; + line-height: 1.25 ; +} + +table.book td { + vertical-align: top ; +} + +table.book td.cover { + padding-right: 1em ; +} + +table.book img { + border: solid #000080 1px ; + border-radius: 2px ; +} + +table.book span { + font-size: small ; + text-align: left ; + display: block ; + margin-top: 0.25em ; +} + +p.logos a:link:hover, p.logos a:visited:hover { + background-color: inherit ; +} + +img { + background-color: white ; +} diff --git a/docs/manual.css b/docs/manual.css new file mode 100644 index 0000000..aa0e677 --- /dev/null +++ b/docs/manual.css @@ -0,0 +1,21 @@ +h3 code { + font-family: inherit ; + font-size: inherit ; +} + +pre, code { + font-size: 12pt ; +} + +span.apii { + color: gray ; + float: right ; + font-family: inherit ; + font-style: normal ; + font-size: small ; +} + +h2:before { + content: "" ; + padding-right: 0em ; +} -- cgit v1.2.3-55-g6feb