1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
CHANGES:
CHANGE 54: BGe 10-Jan-13
* version 3.4.2
* Don't pull "package" settings in the timer lane
* removed a limitation preventing Lua functions with indirect recursive upvalue references from being transferable
CHANGE 53: BGe 11-Dec-2012
* version 3.4.1
* new function lanes.timers(), returns a list of all active timers.
CHANGE 52: BGe 03-Dec-2012
* linda:send() and linda:receive() no longer triggers string->number autocoercion when checking for the optional timeout argument:
a string is always a linda slot, even if coercible.
CHANGE 51: BGe 27-Nov-2012
* linux flavors with older glibc use prctl instead of pthread_setname_np
* selfdestruct chain handling is now the same on all platforms
CHANGE 50: BGe 22-Nov-2012
* bugfix: linda:set() no longer clears the storage limit
CHANGE 49: BGe 21-Nov-2012
* fix application shutdown crash by not registering anything with atexit()
* rockspec for version v3.4.0
CHANGE 48: BGe 25-Sep-2012
* version 3.4.0
* new method linda:dump() that outputs the full contents of a linda as a table, also linked to __towatch for Decoda support
* linda:receive() API change!
* instead of [val, key], linda:receive( timeout, key) returns [key, val]
* instead of [val, [...]], linda:receive( timeout, linda.batched key) returns [key, val[, ...]]
this is to unify the return values of regular and batched mode, and to be able to tell when batched mode is interrupted by a lane cancellation
* fixed Lua 5.2 build to take into account the "loaders"->"searchers" name change in 'package' module.
* a bit of html cleanup and added some infos in the documentation regarding the Lanes internals
CHANGE 47: BGe 13-Sep-2012
* implemented set_debug_threadname() for pthread builds where possible
* refactored linda __tostring and __concat
CHANGE 46: BGe 10-Sep-2012
* version 3.3.0
* lane.status can return "killed" if lane was forcefully killed with lanes:cancel()
* lane:join(): return nil, "killed" if called on a killed lane.
* lane[<n>]: produces [1] = nil, [2] = "killed" if the lane was killed
* lane:join(): fixed an assertion in debug builds when joining a lane forcefully cancelled with lane:cancel( <x>, true).
* indexing a lane with a string other than "join", "cancel" or "status" raises an error.
* fixed configure() to correctly apply defaults when they are missing from the provided settings
* added a shutdown_timeout to control the duration Lanes will wait for graceful termination of running lanes at application shutdown. Default is 0.25.
CHANGE 45: BGe 21-Aug-2012
* keeper internals implemented in C instead of Lua for better performances
* fixed arguments checks in linda:limit() and linda:set()
CHANGE 44: BGe 13-Aug-2012
* lanes code updated to build against Lua 5.1 and Lua 5.2
* removed the search for MSVCR80.DLL when building for MinGW32 since it no longer seems to be necessary
CHANGE 43: BGe 09-Aug-2012
* fix possible crash at application shutdown when a race condition causes linda objects to be collected after the keeper states are cleaned up.
CHANGE 42: BGe 06-Aug-2012
* lanes.linda() accepts an optional name for debug purposes
CHANGE 41: BGe 07-Jul-2012
* lua51-lanes renamed lanes/core
* keeper state microcode is no longer embedded inside lanes.core, but located and loaded with package.loaders[2]
* changed rockspec build type from "make" to "builtin"
CHANGE 40: BGe 26-Jun-2012
* when a transfered function is not found in source, guess its name to help the user find out what's wrong
* new function lanes.nameof()
CHANGE 39: BGe 23-Jun-2012
* lanes.timer() accepts a first_secs=nil to stop a timer
* timer lane catches errors and prints them
* fixed some typos in manual
CHANGE 38: BGe 11-Jun-2012
* linda:receive() batched mode now accepts a max_count optional argument
CHANGE 37: BGe 4-Jun-2012 (fix and idea courtesy of sonoro1234)
* fixed thread_cancel() not working when called without argument
* new lane-global function set_error_reporting() to enable more data detailed data provided by lane_error()
CHANGE 36 BGe 26-Apr-2012
* improved LuaJIT2 compatibility by handling "*" library set through luaL_openlibs()
CHANGE 35 BGe 17-Feb-2012
* changed lanes.configure signature to receive a table instead of individual parameters
* added support for an on_state_create callback called to load custom functions in a state in addition to the base libraries
CHANGE 34 BGe 14-Nov-2011
* removed packagepath and packagecpath options, replaced by a package table, whose fields path, cpath, loaders, preload are transfered
* code cleanup to facilitate transition between WIN32 and PTHREAD impleentations
* tentative fix for desinit crashes when free running lanes are killed at process shutdown
CHANGE 33 BGe 5-Nov-2011: Lanes version 3.0-beta
* process exit change: close everything at GC when main state closes, not when atexit() handlers are processed
* Lua 5.2-style module:
* module() is no longer used to implement lanes.lua
* a global "lanes" variable is no longer created when the module is required
* the Lanes module table is returned instead
* Lanes must be initialized before used:
* the first occurence of 'require "lanes"' produces a minimal interface that only contains a configure() function
* the remainder of the interface is made available once this function is called
* subsequent calls to configure() do nothing
* configure() controls the number of keeper states and the startup of timers
* LuaJIT 2 compatibility
* non-Lua functions are no longer copied by creating a C closure from a C pointer, but through 2-way lookup tables
* this means that if a lane function body pulls non-Lua functions, the lane generator description must contain the list of libraries and modules that exports them
* introduces a change in configuration .globals management: contents are copied *after* std libs are loaded
* new .required configuration entry to list modules that must be require()'ed before lane body is transferred
* lane:cancel() wakes up waiting lindas like what is done at lane shutdown
CHANGE 32 BGe 14-May-2011
* raise an error when linda:send() has nothing to send
CHANGE 31 BGe 17-Apr-2011
* linda uses a fast FIFO implementation to speed up data exchanges
* new linda:count() method
* new linda batched data read mode
* proper key type check in all linda methods
* fix setup-vc.cmd to support Visual Studio 2010 and Windows 7 64 bits
* bugfix: release keeper state mutex at desinit
CHANGE 30 BGe 30-Mar-2011
* linda honors __tostring and __concat
* new accessor linda:keys(), to retrieve the list of keys with pending data inside a linda
* new lanes options packagepath and packagecpath, in case one needs to set them differently than the default
CHANGE 29 BGe 1-Mar-2011
fixed potential crash at application shutdown when calling lua_close() on a killed thread's VM.
exposed cancel_test() in the lanes to enable manual testing for cancellation requests.
removed kludgy {globals={threadName}} support, replaced with a new function set_debug_threadname().
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
CHANGE 27 BGe 17-Feb-2011
- we know Lanes is loaded in the master state, so we don't force it
to be required in every lane too when a linda deep userdata is copied
- Refactor lane proxy implementation: it is now a full userdata instead
of a table, and its methods are implemented in C instead of Lua
* its metatable is no longer accessible
* writing to the proxy raises an error
* it is no longer possible to overwrite its join() and cancel() methods
- when a deep userdata idfunc requests a module to be required, manually
check that it is not loaded before requiring it instead of relying on
the require function's loop detection feature
- when a module must be required, raise an error if the 'require' function
is not found in the target state
CHANGE 26 BGe 14-Feb-2011:
Fixed application hang-up because keeper state was not released in case of errors thrown by
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
and to be able to require the module it was exported from in the target lanes
CHANGE 24 DPtr 25-Jan-2011:
Changed lanes.c to export functions as a module rather than writing them directly to the globals table.
CHANGE 23 DPtr 23-Jan-2011:
Fixed bug where reference to Linda object was dropped for a short time ( crashing if GC was run during that time ).
Changed the atexit code to trip the timer thread's write signal.
CHANGE 22 DPtr 19-Jan-2011:
Changed luaG_push_proxy to cache deep userdata proxies.
CHANGE 21 (bugfixes) BGe 3-Jan-2011:
Several fixes by Martin Krpan:
- 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
CHANGE 20 BGe 3-Dec-2010:
Enable to specify a string as lane code instead of a function so that we dont use lua_dump, which
isn't supported by LuaJIT.
CHANGE 19 BGe 2-Dec-2010:
No longer rely on global function 'tostring' to generate unique identifiers when caching data being transfered through la linda. Should fix a compatilibity issue with LuaJIT2.
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
CHANGE 17 BGe 21-Sept-2010:
Fixed stupid compilation errors.
CHANGE 16 PLM 24-Aug-2010:
Releasing memory at gc / atexit.
Finalizers actually get error strings.
Fixed missing argument propagation in lane:cancel
Added variable threadName sent trough globals-table. Set in s_lane, and in debuggers on windows.
Added argument checking for linda-objects, where missing them caused crashes.
CHANGE 15 (minor) BGe 27-Jul-2010:
Version bump for a true upgrade release (2.0.4 package was only a renamed 2.0.3)
CHANGE 14 (bug fix) BGe 09-Jul-2010:
Fixed lane status to be correctly returned as "waiting" when it should.
CHANGE 13 (fix for multithreaded host apps) AKa 24-Jun-2009:
<borisusun-at-gmail> mentioned Lanes expects the host application to be singlethreaded,
and there are troubles if Lanes is used from multiple threads, opened by the host
(before requiring Lanes). This is true, and fix should now be in place.
CHANGE 12 (bug fix on Windows, 2.0.3) AKa 25-Jan-2009:
Did CHANGE 9 the way it should be done.
CHANGE 11 (new feature, 2.0.3) AKa 23-Jan-2009:
Finalizers ('set_finalizer()') for being able to do cleanup of a lane's
resources, whether it returned succesfully or via an error.
CHANGE 10 (new feature, 2.0.3) AKa 23-Jan-2009:
Call stack showing where an error occurred is not merged with the error
message, but delivered as a separate stack table ({ "filename:line" [, ...] }).
Getting call stacks of errorred lanes is now possible.
CHANGE 9 (bug fix on Windows) AKa 10-Dec-2008 (> 2.0.2):
Applied patch from Kriss Daniels to avoid issues on 'now_time()' in Win32
(http://luaforge.net/forum/forum.php?thread_id=22704&forum_id=1781).
CHANGE 8 (bug fix) AKa 26-Oct-2008:
Avoids occasional segfault at process exit (on multicore CPUs). Does this
by keeping track of "free running" threads (s.a. the time thread) and
cancelling them at process exit.
Tested (2.0.2) on Linux 64,x86, OS X, WinXP.
CHANGE 7 (bug fix) AKa 15-Oct-2008:
Recursive functions that use themselves as direct upvalue can now be
passed to other lanes, and used as a lane function.
CHANGE 6 (bug fix) AKa 15-Oct-2008:
Added local caches of the following to src/lanes.lua (was otherwise getting
errors at least in 'tests/irayo_recursive.lua').
local assert= assert
local string_gmatch= assert( string.gmatch )
local select= assert( select )
local type= assert( type )
local pairs= assert( pairs )
local tostring= assert( tostring )
local error= assert( error )
local setmetatable= assert( setmetatable )
local rawget= assert( rawget )
Thanks to Irayo for detecting and reporting this.
CHANGE 5 (new feature):
Modifying Makefile so it's better suited to LuaRocks.
CHANGE 4 (new feature):
Metatable copying, allowing Lua objects to be copied across lanes.
CHANGE 3 (bug fix) AKa 5-Aug-2008:
The '__gc' method was not tied to thread userdata, at all. Caused memory
lifespan problems at least on OS X when threads were cancelled (EINVAL).
CHANGE 2 (bug fix) AKa 5-Aug-2008:
Better calculation of timeouts, always making them absolute (even in Win32)
to allow for events that wake the lane up but don't read/write the Linda
key that it was observing.
CHANGE 1 (bug fix) AKa 4-Aug-2008:
Signalling woke up only one waiting thread, not all. This caused i.e.
receive to not wake up if there was another thread waiting on the same
Linda object.
PThread fix: using 'pthread_cond_broadcast()' instead of 'pthread_cond_signal()'
Win32 fix: using manual events and 'PulseEvent()'
(end)
|