From 974aa4343cf900938b5d357d10798d91faf60f5a Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 21 Feb 2011 20:33:39 +0100 Subject: Make the number of internal keeper states selectable by an optional parameter passed to require. --- CHANGES | 11 +++++++---- docs/index.html | 41 ++++++++++++++++++++++++++++++++--------- src/keeper.c | 39 +++++++++++++++++++-------------------- src/keeper.h | 2 +- src/lanes.c | 33 +++++++++++---------------------- src/lanes.lua | 2 +- 6 files changed, 71 insertions(+), 57 deletions(-) diff --git a/CHANGES b/CHANGES index 1850415..bc0368a 100644 --- a/CHANGES +++ b/CHANGES @@ -3,9 +3,12 @@ CHANGES: CHANGE X: +CHANGE 29 BGe 21-Feb-2011 + Make the number of internal keeper states selectable by an optional parameter passed to require. + CHANGE 28 BGe 18-Feb-2011 - - moved keeper-related code in a separate source file - - keeper.lua is now embedded in text form instead of bytecode to improve LuaJIT2-compatibility + Moved keeper-related code in a separate source file + keeper.lua is now embedded in text form instead of bytecode to improve LuaJIT2-compatibility CHANGE 27 BGe 17-Feb-2011 - we know Lanes is loaded in the master state, so we don't force it @@ -26,7 +29,7 @@ CHANGE 26 BGe 14-Feb-2011: inter-state data copy for unsupported types CHANGE 25 BGe 12-Feb-2011: - Changed idfunc signature and contract to clarify that fact it is not lua-callable + Changed idfunc signature and contract to clarify the fact it is not lua-callable and to be able to require the module it was exported from in the target lanes CHANGE 24 DPtr 25-Jan-2011: @@ -56,7 +59,7 @@ CHANGE 19 BGe 2-Dec-2010: CHANGE 18 BGe 6-Oct-2010: Fixed 'memory leak' in some situations where a free running lane is collected before application shutdown - A bit of code cleanup + A bit of code cleanup CHANGE 17 BGe 21-Sept-2010: Fixed stupid compilation errors. diff --git a/docs/index.html b/docs/index.html index a28dd41..3d2ecf2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -56,7 +56,7 @@


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 12-Feb-11, and applies to version 2.0.11. +

This document was revised on 21-Feb-11, and applies to version 2.1.0.

@@ -817,12 +817,12 @@ can be used for custom userdata as well. Here's what to do. "delete": receives this same pointer on the stack, and should cleanup the object.
  • "metatable": should build a metatable for the object. Don't cache the metatable -yourself, Lanes takes care of it ("metatable" should only be invoked once).
  • + yourself, Lanes takes care of it ("metatable" should only be invoked once).
  • "module": is the name of the module that exports the idfunc, -to be pushed on the stack as a string. It is necessary so that Lanes can require it in -any Lane and keeper state that receives a userdata. This is to prevent crashes in situations -where the module could be unloaded while the idfunc pointer is still held.
  • + to be pushed on the stack as a string. It is necessary so that Lanes can require it in + any Lane and keeper state that receives a userdata. This is to prevent crashes in situations + where the module could be unloaded while the idfunc pointer is still held. Take a look at linda_id in lanes.c. @@ -917,10 +917,10 @@ Here are some things one should consider, if best performance is vital: merged into one main timer state (see timer.lua); no OS side timers are utilized. -
  • Lindas are hashed to a fixed number of "keeper states", which are a locking entity. - 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 KEEPER_STATES_N), but this is an implementation detail. +
  • Lindas are hashed to a number of "keeper states", which are a locking entity. + 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 but this is an implementation detail. + It is possible to require( "lanes", N) to use more keeper states.
  • @@ -952,6 +952,29 @@ its actual value.

    Change log

    +Feb-2011 (2.1.0) +

    + Feb-2011 (2.0.11):