From 79e46938c5d8daf164ab2d934f668fa27b32e4cf Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 4 Jan 2011 21:31:17 +0100 Subject: Take all code from Asko Kauppi's SVN server, and push it here so that the github repository becomes the official Lanes source codebase. Note that Asko's SVN server holds version 2.0.9, whereas this is version 2.0.10, but I don't see any real need to update SVN if it is to become deprecated. Next steps: - upgrade the rockspec to the latest version - make the html help available online somewhere Signed-off-by: Benoit Germain --- docs/comparison.html | 28 +++++++++++++++++++++++++++- docs/index.html | 44 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 66 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/comparison.html b/docs/comparison.html index 84ef9ca..bebc68b 100644 --- a/docs/comparison.html +++ b/docs/comparison.html @@ -49,6 +49,7 @@ Pros: Cons: - requires OS threads + - currently 1:1 mapping to OS threads (limits scalability and maybe performance) - not utilizing network parallelism (all threads on one CPU) Sample: @@ -70,6 +71,31 @@ Sample: << +=========== + luaproc (by Skyrme, Rodriguez and Ierusalimschy) +=========== + +http://www.inf.puc-rio.br/~roberto/docs/ry08-05.pdf + +The PDF seems to be an authorative voyage into how Lua could handle multithreading, +in a multicore "separate universes" manner (not like what coroutines already do). + +Pros: + - Tackles both multicore and network parallelism + - M:N relationship to kernel threads (one kernel thread runs multiple luaprocs) + - Simple (so they say) + - Lua author (Roberto) included + - Can be used also without _any_ OS threading support (works like Rings, then) + +Cons: + - Data passing for "strings, number, or booleans" only + "More complex types must be encoded in some form" + (serializing data is slower than the stack-to-stack copies used by i.e. Lanes) + (yet, serializing allows for network parallelism) + - Message passing is synchronous (only). The sender will wait until the + receiver has taken the message. + + ================== Lua coroutines (by Lua authors) ================== @@ -157,7 +183,7 @@ but it won't use more than one CPU core. Other differences include: (Lanes opens the needed ones) - marshalls numbers, strings, booleans, userdata - (Lanes marshalls also non-cyclic tables) + (Lanes also marshalls tables, functions, upvalues, ..) - "remotedostring" allows executing code in the master state (Lanes does _not_ allow subthreads to trouble/modify master automatically, diff --git a/docs/index.html b/docs/index.html index 956e691..45b52bc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,9 +54,9 @@ Change log -


Copyright © 2007-08 Asko Kauppi. All rights reserved. +


Copyright © 2007-11 Asko Kauppi. All rights reserved.
Lua Lanes is published under the same MIT license as Lua 5.1. -

This document was revised on 23-Jan-09, and applies to version 2.0.3. +

This document was revised on 3-Jan-11, and applies to version 2.0.10.

@@ -195,6 +195,9 @@ joins the threads, waiting for any results not already there. 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 is to be able to launch lanes whith LuaJIT, + which does not support lua_dump, used internally to transfer functions to the lane.
@@ -378,7 +387,7 @@ 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.

-

Cancellation is tested before going to sleep in receive() or send() calls +

Cancellation is tested before going to sleep in receive() or send() calls and after executing cancelstep Lua statements. A currently pending receive or send call is currently not awakened, and may be a reason for a non-detected cancel.

@@ -920,6 +929,30 @@ its actual value.

Change log

+Jan-2011 (2.0.10): +

    +
  • linda_send was waiting on the wrong signal
  • +
  • buildfix when using i586-mingw32msvc-gcc cross compiler
  • +
  • lanes_h:cancel() returns a boolean as it should
  • +
  • timers could get blocked sometimes because they were initialized with negative values
  • +
  • prepare_timeout could generate an illegal setting
  • +
+ +Dec-2010 (2.0.9): +
    +
  • Fixed 'memory leak' in some situations where a free running lane is collected before application shutdown
  • +
  • Fix LuaJIT2 incompatibility (no 'tostring' hijack anymore)
  • +
  • Added support to generate a lane from a string
  • +
+ +Aug-2010 (2.0.6): +
    +
  • Fixed some memory leaks
  • +
  • Fixed error in passing parameters to finalizers
  • +
  • Fixed missing argument propagation in lane:cancel
  • +
  • Added thread name debugging in VS
  • +
+ Jan-2009 (2.0.3):