From: <me...@ho...> - 2005-10-12 13:10:05
|
Currently threads act like dynamic closures that capture _all_ dynamic=20 variables. This has a number issues: 1) dynamic-extent Suppose your package has a non-exported special, binds it, promises it's=20 going to be dynamic extent and proceeds to call user code. The user=20 code spawns a thread and the promise is broken. 2) gc It's hard to control giving out references to objects. Yeah, it's=20 similar to 1), but colour of the smoke is different. 3) scaling When starting up, a thread is given a snapshot of the parent thread's=20 current values for dynamic variables. This means that the minimum=20 memory required by a thread is proportional to the number of specials. AFAIK SBCL's approach is unique. In my current state of mind I can only=20 see the drawbacks and moving to a more conventional design is luring: make-thread (function &key name initial-bindings) or maybe even make-thread (function &key name (initial-bindings *default-bindings*)) What do you think? G=E1bor |