aboutsummaryrefslogtreecommitdiff
path: root/CHANGES
blob: 0a6889d7434c81713e0a000c3c1fec160e433a4c (plain)
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
CHANGES:

CHANGE 89: BGe 09-Jan-14
   * version 3.7.7
   * fix crash when calling linda:count() on unknown keys
   * purge key storage with linda:set( key, nil) on an unlimited key to reduce memory usage with lots of keys
   * linda:limit() wakes write-blocked threads if necessary when the new limit enables writes to occur again
   * linda:set() wakes write-blocked threads if necessary if the operation created some room to write into

CHANGE 88: BGe 06-Jan-14
   * version 3.7.6
   * if config.on_state_create() is a C function, call it by direct C closure reconstruction in newly created states

CHANGE 87: BGe 20-Dec-13
   * version 3.7.5
   * fixed a crash that can occur at shutdown when an object stored inside a keeper state performs a linda operation on a linda making use of another keeper
   * new setting demote_full_userdata to select between light userdata demotion or raising an error when attempting to transfer a non-deep full userdata

CHANGE 86: BGe 3-Dec-13
   * version 3.7.4
   * internal refactoring of pthread priority management code
   * new API lanes.set_thread_priority()

CHANGE 85: BGe 28-Nov-13
   * version 3.7.3
   * set pthread thread cancel type to PTHREAD_CANCEL_ASYNCHRONOUS
   * lane_h:cancel() accepts a 3rd timeout argument used when waiting for actual thread termination (hitting the timeout raises an error)
   * added PROPAGATE_ALLOCF macro to select state creation mode (lua_newstate or luaL_newstate)

CHANGE 84: BGe 18-Nov-13
   * Fix a deadlock when GCing during a linda operation.
   * Fix a compilation warning about an unused variable
   * Get rid of uintptr_t to remove dependency on stdint.h
   * Fix internal error at lane creation when the generator doesn't open any base library

CHANGE 83: BGe 16-Nov-13
   * version 3.7.2
   * Fixed function returned by lanes.genlock() not handling numeric keys properly when release lock
   * Enable lanes.genlock() to attempt lock with an optional "try" mode
   * make EnableCrashingOnCrashes a one-time operation

CHANGE 82: BGe 13-Nov-13
   * Fix a case where an error could be raised inside a keeper state

CHANGE 81: BGe 07-Nov-13
   * Make set_finalizer(), set_debug_threadname(), cancel_test() and set_error_reporting() transferable from lane to lane
   * Improved some DEBUGSPEW output

CHANGE 80: BGe 06-Nov-13
   * Fix a few compilation warnings about uninitialized variables
   * Fixed a bad extern variable declaration resulting in multiple instances (crashes the Pelles-C build)

CHANGE 79: BGe 04-Nov-13
   * Fix lanes.nameof() crashing when encountering a light userdata

CHANGE 78: BGe 25-Oct-13
   * Fix windows build not exporting public 'deep' API
   * Don't call on_state_create in keeper states, as it is no longer necessary
   * Remove inclusion of stdint.h
   * Fix windows build for WINVER > 0x400

CHANGE 77: BGe 22-Oct-13
   * version 3.7.1
   * errors inside finalizers generate a full stack just like any other error

CHANGE 76: BGe 10-Oct-13
   * version 3.7.0
   * fix lanes.threads() not being available in a lane where lanes.configure() settings didn't contain track_lanes although the initial configure() call did.

CHANGE 75: BGe 7-Oct-13
   * require "lanes".configure() sequence is only necessary at the first require "lanes".

CHANGE 74: BGe 7-Oct-13
   * fix a crash at application shutdown where in some situations we could deinitialize the protected allocator mutex while a lane was still using it.

CHANGE 73: BGe 4-Oct-13
   * fix timers broken by change 69

CHANGE 72: BGe 3-Oct-13
   * bugfix: no longer create a global named "lanes.core" inside lanes having "*" as library list

CHANGE 71: BGe 30-Sept-13
   * version 3.6.6
   * properly handle cases when a Lua C module is a C function

CHANGE 70: BGe 27-Step-13
   * no longer call core.configure with dummy params when requiring lanes more than once (fixes potential multithreading issues with LuaJIT allocator)
   * activated EnableCrashingOnCrashes() is active on Win32 debug builds
   * fixed some comments in code

CHANGE 69: BGe 26-Sept-13
   * version 3.6.5
   * Reduce memory footprint, simplify module order setup in conjuction with Lanes, and send over native functions a bit faster as well
   * Lanes no longer has to internally require modules inside the keeper states because they no longer need a lookup database
     the lookup name is stored as-is and actually converted in the destination state
   * optimisation: bypass cache when sending native functions over
   * removed all the KEEPER_MODEL_LUA code, as it can no longer work anyway

CHANGE 68: BGe 24-Sept-13
   * version 3.6.4
   * Fix possible application hang at shutdown if a keeper state referenced a linda.

CHANGE 67: BGe 2-Aug-13
   * version 3.6.3
   * lane:cancel(<negative-timeout>) only causes cancel_test() to return true but won't interrupt execution of the lane during linda operations

CHANGE 66: BGe 31-Jul-13
   * more explicit errors when trying to transfer unknown source functions (with new configure option verbose_errors)

CHANGE 65: BGe 23-Jul-13
   * default options wrap allocator around a mutex when run by LuaJIT

CHANGE 64: BGe 20-Jul-13
   * WIN32 builds against pre-Vista versions no longer use PulseEvent to fix occasional hangs when a wake event is missed

CHANGE 63: BGe 20-May-13
   * version 3.6.2
   * WIN32 builds use condition variables instead of PulseEvent() when available.
   * first steps toward fixing make-vc.cmd

CHANGE 62: BGe 05-Apr-13
   * version 3.6.1
   * function lookup database population keeps the 'smaller' name in case of multiple hits, to remove the no-LUA_COMPAT_ALL restriction on Lua5.2 builds

CHANGE 61: BGe 14-Mar-13
   * version 3.6.0
   * protect_allocator is an API change -> version bump
   * bugfix: allocator protection should be done once per primary Lua state, not once only the first time ever Lanes is required

CHANGE 60: BGe 13-Mar-13
   * version 3.5.2
   * stricter validation of with_timers config option: validator was accepting any non-boolean value
   * new configuration option protect_allocator for VMs with thread unsafe allocators (such as LuaJIT)
   * removed some obsolete bits of dead code

CHANGE 59: BGe 12-Feb-13
   * version 3.5.1
   * new lanes.h header and API call luaopen_lanes_embedded() for embedders
   * "lanes.core" is an acceptable library in the generator libs argument
   * library "*" wildcard also opens lanes.core
   * tweaked code for Xbox 360 build

CHANGE 58: BGe 30-Jan-13
   * version 3.5.0
   * new: API lanes.require(), use it instead of regular require() for modules that export C functions you need to send over.
   * new: lanes no longer require 'lanes.core' by default in every created state. Use {required={"lanes.core"}} if you need to transfer lanes functions.
   * internal: because of the above, reworked the timer implementation to remove upvalue-dependency on lanes.core
   * new: API lanes.timer_lane, to be able to operate on timer lane if need be
   * improved: if a module is a full userdata, scan its metatable for function database population
   * improved: on_state_create can be a Lua function
   * changed: on_state_create is called after the base libraries are loaded
   * package[loaders|searchers] is no longer transfered as function naming depends on slot order
   * internal: changed separator from '.' to '/' in lookup databases to be able to distinguish search levels and dot coming from module names
   * added some mode debug spew
   * updated tests to reflect the above changes

CHANGE 57: BGe 28-Jan-13
   * More detailed DEBUG_SPEW logs
   * A bit of code cosmetics

CHANGE 56: BGe 25-Jan-13
   * version 3.4.4
   * bugfix: take into account the fact that "coroutine" is no longer part of base library in Lua 5.2
   * bugfix: if "bit32" was listed in the libraries, it wouldn't open (library list parsing failing on digits)
   * bugfix: Use luaL_requiref() to open standard libraries in Lua 5.2 as we should
   * bugfix: any Lua state created by Lanes reuses the allocator function of the originating state
   * bugfix: don't call on_state_create() while GC is suspended during lua state initialization

CHANGE 55: BGe 24-Jan-13
   * version 3.4.3
   * raise an error if lane generator libs specification contains a lib more than once
   * bit32 is a valid lib name in the libs specification (silently ignored by the Lua 5.1 build)
   * improved lanes.nameof to search inside table- and userdata- metatables for an object's name
   * bugfix: fixed an unwarranted error when trying to discover a function name upon a failed transfer
   * contents of package.[path,cpath,preload,loaders|searchers] are pulled *only once* inside keeper states at initialisation
   * Lua function upvalues equal to the global environment aren't copied by value, but bound to the destination's global environment
     especially useful for Lua 5.2 _ENV
   * bugfix: fixed loading of base libraries that didn't create the global tables when built for Lua 5.2

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 implementations
   * 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)