Dynamic variables

Henry G. Baker hbaker@netcom.com
Fri, 16 May 1997 16:31:01 -0700 (PDT)


> > Can't dynamic variables be implemented efficiently by storing the
> > current value in the global place, and pushing the old global value on
> > the stack. When the local binding of the variable goes out of scope
> > you pop the old value off the stack and replace the global position
> > with the original value. Thus lookups are always constant and fast.
> 
> There's a problem with parallel threads there...
> 
> Alaric B. Williams (alaric@abwillms.demon.co.uk)

Actually, there isn't really a problem with parallel threads there.

My Shallow Binding paper was written to address precisely this issue.

ftp://ftp.netcom.com/pub/hb/hbaker/ShallowBinding.html  (also .ps.Z)

The fix is to always put an alist search before checking the global
variable, and then make sure the alist search is trivial!  The check
handles the case where another thread messed with the environment in
between.

-- 
Henry Baker
www/ftp directory URL:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html