This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Gargage collected top-level bindings?
- From: Per Bothner <per at bothner dot com>
- To: Dean Ferreyra <dferreyra at igc dot org>
- Cc: dominique dot boucher at nuecho dot com, "'Kawa List'" <kawa at sources dot redhat dot com>
- Date: Thu, 05 May 2005 09:35:25 -0700
- Subject: Re: Gargage collected top-level bindings?
- References: <200504291127.j3TBR2f4012711@bergman.nuecho.ad> <4277E288.3090507@igc.org>
Dean Ferreyra wrote:
I've seen this behavior when initializing and using Kawa modules from
Java directly, in threads that were created from Java but not with
(future ...). When the thread that has initialized the module ends,
some binding-related thread-local objects are garbage collected, the
symbols are unbound, and from then on the module's global bindings give
the UnboundLocationException exception.
Assuming that we're seeing the same problem, attached is my temporary
kludge around it.
Note that I'm not sure this is a bug in Kawa, and I'm fairly sure this
temporary kludge is *not* The Right Thing.
Kawa "global" bindings are fluid and thread-local, so if you create a
binding in one thread, and the thread ends goes away, then so does the
binding. If you have a static module, you might still be able to
reference the ThreadLocation from a different thread, but it will be
unbound.
Using the dynamic environment to access bidnings from a static module
initialized by a diffferent thread is going to be tricky, and it's
not obvious what the "right" behavior is. If you provide some more
details perhaps we can figure out a solution.
--
--Per Bothner
per@bothner.com http://per.bothner.com/